Skip to content

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

@TutuchanXD

Description

@TutuchanXD

Summary

The Ollama-compatible bridge can list the newer OpenAI models such as gpt-5.5, but /api/show reports an incorrect context length for them.

Expected effective context length for the current GPT-5.5 / GPT-5.4 family should be exposed as 400000 tokens to Ollama clients. The current bridge reports smaller values:

  • gpt-5.5: falls back to the default 131072
  • gpt-5.4, gpt-5.4-pro, gpt-5.4-mini, gpt-5.4-nano: currently use 272000

This causes clients that rely on Ollama model metadata to under-estimate the available context window.

Where it happens

In src/ollama/bridge.ts, inferContextWindow() returns values from CONTEXT_WINDOW_OVERRIDES, otherwise it falls back to 131072.

Current override table includes GPT-5.4-family entries at 272000, but does not include gpt-5.5, so GPT-5.5 receives the fallback value.

The value is then surfaced by /api/show in:

  • parameters: num_ctx <contextLength>
  • model_info["<architecture>.context_length"]
  • model_info.context_length

Reproduction

  1. Enable the Ollama bridge.
  2. Query model metadata, for example:
curl http://localhost:<ollama-port>/api/show \
  -d "{\"model\":\"gpt-5.5\"}"
  1. Check parameters / model_info.context_length.

Actual: 131072 for gpt-5.5.

Expected: 400000.

For gpt-5.4, actual is currently 272000; expected is also 400000.

Suggested fix

Update the Ollama bridge context override table so current GPT-5.5 / GPT-5.4 models expose 400000, e.g.:

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

It may also be worth adding a small unit test around /api/show or inferContextWindow() so newly added model IDs do not silently fall back to 131072.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions