Skip to content

fix: correct Ollama context metadata for GPT-5.5 and GPT-5.4 models#420

Merged
icebear0828 merged 1 commit intoicebear0828:devfrom
TutuchanXD:codex/ollama-context-400k
Apr 29, 2026
Merged

fix: correct Ollama context metadata for GPT-5.5 and GPT-5.4 models#420
icebear0828 merged 1 commit intoicebear0828:devfrom
TutuchanXD:codex/ollama-context-400k

Conversation

@TutuchanXD
Copy link
Copy Markdown
Contributor

Summary

Fixes the Ollama bridge metadata for current GPT-5.5 / GPT-5.4 models so /api/show reports a 400k effective context window instead of smaller stale fallback values.

This updates the bridge context override table for:

  • gpt-5.5
  • gpt-5.4
  • gpt-5.4-pro
  • gpt-5.4-mini
  • gpt-5.4-nano

It also adds GPT-5.5 family detection so Ollama model_info uses gpt-5.5.context_length instead of falling back to the generic gpt.context_length key.

Fixes #419.

Why this is hardcoded for now

I checked the current Codex model info endpoint exposed by the proxy (/v1/models/gpt-5.5/info and /v1/models/gpt-5.4/info). The returned model metadata includes reasoning efforts and modalities, but does not include a context-window field such as context_window, contextLength, or context_length.

Because the upstream model info does not currently provide context length, the Ollama bridge has no dynamic source to sync from. This PR therefore keeps the existing override-table approach and updates that table to the current 400k effective context size for the GPT-5.5 / GPT-5.4 family.

Root cause

gpt-5.5 was not present in CONTEXT_WINDOW_OVERRIDES, so it fell back to 131072. GPT-5.4-family entries were still set to 272000.

Validation

  • npx vitest run tests/unit/ollama/bridge.test.ts
  • npx vitest run tests/unit/models/model-store.test.ts tests/unit/ollama/bridge.test.ts
  • npx vitest run tests/unit
  • npm run build

@icebear0828 icebear0828 changed the base branch from master to dev April 29, 2026 21:49
@icebear0828 icebear0828 marked this pull request as ready for review April 29, 2026 21:49
@icebear0828 icebear0828 merged commit ece0250 into icebear0828:dev Apr 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ollama bridge reports too-small context length for gpt-5.5/gpt-5.4

2 participants