Skip to content

fix(ollama-cloud): correct 3 context_lengths, add 3 served-but-missing tags - #5109

Open
mikkihugo wants to merge 2 commits into
anomalyco:devfrom
mikkihugo:fix/ollama-cloud-context-lengths
Open

fix(ollama-cloud): correct 3 context_lengths, add 3 served-but-missing tags#5109
mikkihugo wants to merge 2 commits into
anomalyco:devfrom
mikkihugo:fix/ollama-cloud-context-lengths

Conversation

@mikkihugo

@mikkihugo mikkihugo commented Aug 20, 2026

Copy link
Copy Markdown

All values read from the provider via ollama.com/api/show, the same source the existing deepseek-v4-flash:0731 entry already cites.

1. Corrected limit.context (3 models)

model current provider reports
glm-5.2 976,000 1,000,000
minimax-m3 512,000 524,288
nemotron-3-nano:30b 1,048,576 262,144

nemotron-3-nano:30b is the one that bites: the recorded window is 4x the real one, so a client sizing requests from this database overruns the model and the provider rejects the request. I hit exactly that in practice before checking against the API.

2. Added 3 tags that are served but not catalogued (new files)

GET https://ollama.com/v1/models lists these three; the database had no entry.

model context
deepseek-v4-pro:0813 1,048,576
deepseek-v4-pro:preview 524,288 — half the stable tag
deepseek-v4-flash:preview 1,048,576

How to reproduce

curl -s https://ollama.com/api/show \
  -H "Authorization: Bearer $OLLAMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"model\":\"nemotron-3-nano:30b\"}" \
  | jq -r ".model_info | to_entries[] | select(.key|endswith(\"context_length\"))"

Observed:

glm5.2.context_length            = 1000000
minimax-m3.context_length        =  524288
nemotron-3-nano.context_length   =  262144
deepseek4.context_length         = 1048576   # deepseek-v4-pro:0813
deepseek4.context_length         =  524288   # deepseek-v4-pro:preview
deepseek4.context_length         = 1048576   # deepseek-v4-flash:preview

I checked all 17 other ollama-cloud entries the same way; they already match and are untouched.

Scope notes

  • Only providers/ollama-cloud/ is changed.
  • minimax-m3 is deliberately not aligned with the MiniMax entries. minimax/MiniMax-M3 and minimax-coding-plan/MiniMax-M3 are both 1,000,000, and Ollama genuinely serves a smaller window for the same model — the per-provider split here is correct, only the ollama-cloud number was off.
  • output on the corrected models is untouched: api/show reports no max output, so I have no provider-sourced value. On the three new files output mirrors context, following every other deepseek entry under this provider; that field is convention, not API-verified.

Values taken from the provider itself via ollama.com/api/show, which reports
model_info.<family>.context_length.

  glm-5.2              976_000  -> 1_000_000
  minimax-m3           512_000  ->   524_288
  nemotron-3-nano:30b  1048576  ->   262144

nemotron-3-nano:30b is the consequential one: the recorded value is 4x the real
window, so a client sizing requests from it overruns and the provider rejects
them.
Copilot AI lite review requested due to automatic review settings August 20, 2026 04:14
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/ollama-cloud/models/glm-5.2.toml:12 - Check: Override-only base_model files must not restate identical inherited values. Why: After this change, limit.context = 1_000_000 matches models/zhipuai/glm-5.2.toml exactly, so the provider [limit] block is a redundant override (merge blocker). Action: Remove the entire [limit] section so context/output inherit from zhipuai/glm-5.2.
  • [high] [violation] providers/ollama-cloud/models/nemotron-3-nano:30b.toml:13 - Check: Override-only base_model files must not restate identical inherited values. Why: limit.context = 262144 now matches models/nvidia/nemotron-3-nano-30b-a3b.toml (262_144); only output = 131072 still differs from the lab’s 262_144. Action: Drop context from [limit] and keep only the real output delta (output = 131072).

@github-actions github-actions Bot added the reviewer: ready Automated review found no actionable items label Aug 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the ollama-cloud provider catalog to match the actual served context windows reported by Ollama’s api/show, preventing clients from constructing requests that exceed the provider-enforced limits.

Changes:

  • Correct limit.context for glm-5.2 to 1_000_000.
  • Correct limit.context for minimax-m3 to 524_288.
  • Correct limit.context for nemotron-3-nano:30b to 262_144.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
providers/ollama-cloud/models/nemotron-3-nano:30b.toml Reduce limit.context to the provider-reported 262,144 tokens to prevent request overruns.
providers/ollama-cloud/models/minimax-m3.toml Adjust limit.context to 524,288 to match api/show.
providers/ollama-cloud/models/glm-5.2.toml Increase limit.context to 1,000,000 to match api/show.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 12 to 14
[limit]
context = 1048576
context = 262144
output = 131072
Comment on lines 11 to +12
[limit]
context = 976_000 No newline at end of file
context = 1_000_000 No newline at end of file
GET https://ollama.com/v1/models lists these three; the database has no entry.

  deepseek-v4-pro:0813        context 1048576
  deepseek-v4-pro:preview     context  524288   <- half the stable tag
  deepseek-v4-flash:preview   context 1048576

Contexts read from https://ollama.com/api/show, the same source the existing
deepseek-v4-flash:0731 entry cites. Output mirrors context, following every
other deepseek entry under this provider; api/show reports no max output, so
that field is convention rather than API-verified.
@github-actions github-actions Bot removed the reviewer: ready Automated review found no actionable items label Aug 20, 2026
@mikkihugo mikkihugo changed the title fix(ollama-cloud): correct context_length for glm-5.2, minimax-m3, nemotron-3-nano:30b fix(ollama-cloud): correct 3 context_lengths, add 3 served-but-missing tags Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [high] [violation] providers/ollama-cloud/models/deepseek-v4-pro:0813.toml:1 - Check: Non-lab hosts must use base_model; provider files stay override-only. Why: Ollama Cloud did not create DeepSeek V4; lab metadata already exists at models/deepseek/deepseek-v4-pro-0813.toml, and the peer deepseek-v4-flash:0731.toml correctly uses base_model. This full inline definition restates lab fields and skips inheritance (including lab open_weights = false, which this file sets to true). Action: Rewrite as override-only with base_model = "deepseek/deepseek-v4-pro-0813", keep only host deltas (name, reasoning_options, [limit] overrides, optional status), and drop duplicated identical fields.
  • [high] [violation] providers/ollama-cloud/models/deepseek-v4-flash:preview.toml:1 - Check: Non-lab hosts must use base_model when the lab model is nameable. Why: This is a host tag of DeepSeek V4 Flash, not an Ollama-origin model. Full inline definition omits required resolved fields (release_date, last_updated) that lab metadata would supply. Action: Point base_model at deepseek/deepseek-v4-flash (or the dated lab snapshot if that is what :preview serves), keep only Ollama-specific overrides (name, reasoning_options, context/output limits, optional status = "beta"), and do not restate unchanged lab capabilities/modalities.
  • [high] [violation] providers/ollama-cloud/models/deepseek-v4-pro:preview.toml:1 - Check: Non-lab hosts must use base_model when the lab model is nameable. Why: Same third-party host rule as above for DeepSeek V4 Pro; full inline definition again omits release_date/last_updated and duplicates lab-shaped fields. Action: Use base_model = "deepseek/deepseek-v4-pro" (unless a distinct lab snapshot is justified), keep only real host deltas including the half-size [limit] and optional status = "beta".
  • [medium] [violation] providers/ollama-cloud/models/deepseek-v4-flash:preview.toml:7 - Check: Every toggle needs a leading top-of-file wire-path comment. Why: All three new files set reasoning_options with toggle but only document catalog/API context sources, not the Ollama request field. Peer deepseek-v4-flash:0731.toml documents think / reasoning_effort. Action: On each new DeepSeek file, add a leading comment matching the established ollama-cloud peer (e.g. native think = true|false; OpenAI path reasoning_effort / reasoning.effort = high|max).

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.

2 participants