Skip to content

feat(k8s): raise the context length of the condor and hawk Ollama tiers to what their GPUs hold #2822

Description

@dan-petty

What happened

Tier ollama-48gib (node condor, 2 RTX 3090, 48 GiB) serves its models at OLLAMA_CONTEXT_LENGTH=128000. The models on it (qwen3-coder:30b, qwen3.8:27b, gemma4:31b) have a native context of 262144. The owner wants a longer context where the hardware allows it.

Measured on 2026-10-31 on condor, with a temporary model made from qwen3-coder:30b with num_ctx 262144 (removed after the test):

  • At 128000 (the current setting), ollama ps shows 30 GB, and the two GPUs hold 15.3 and 14.5 GiB.
  • At 262144, ollama ps shows 37 GB, 100% GPU. The two GPUs hold 18.9 and 17.9 GiB of 24 GiB each. About 6 GiB per GPU stays free.
  • A prompt of 142214 tokens was read in 84 s (1690 tokens/s). The model followed the instruction at the end of the prompt and answered. GPU memory did not grow during the prompt.
  • The peak GPU memory of the node over 7 days was 32.8 of 48 GiB. The host has 64 GB of memory with 29% in use.

Other tiers (same measurement or arithmetic from the model metadata):

  • hawk (ollama-16gib, RTX 5070 Ti, 16 GiB): gpt-oss:20b with num_ctx 131072 and q4_0 KV loads in 13 GB, with 2.6 GiB free on the GPU. The tier runs 48000 now.
  • gemini (ollama-64gib, 2 V100): the 70B models fill the GPUs at 160000, and that is already above their native 131072. The tier stays.
  • hog (ollama-48gib-slow): fits, but Pascal prefill is slow. The tier stays.

What should happen

  • OLLAMA_CONTEXT_LENGTH of ollama-48gib goes from 128000 to 262144.
  • OLLAMA_CONTEXT_LENGTH of ollama-16gib goes from 48000 to 131072. gpt-oss:20b is the only chat model of this tier that the gateway routes to (devops-review fallback and gpt-oss:20b).
  • The gateway max_input_tokens of the routes to these tiers follow the profiles, rendered with the existing gateway render. Documents that state the numbers are updated.

Evidence

  • ollama ps and nvidia-smi in pods ollama-48gib-dpl5n and ollama-16gib-rctvs on 2026-10-31.
  • Prometheus max_over_time(DCGM_FI_DEV_FB_USED[7d]) per GPU.
  • ollama show -v for the layer counts and KV heads of each model.

Acceptance criteria

  • The two pods run with the new values after the sync, and ollama ps shows the new context for a loaded model.
  • max_input_tokens of the gateway routes matches the tiers (the render test passes).
  • A prompt of more than 140000 tokens through the gateway route devops-coder gets an answer.
  • uv run devops ci passes.

Proposed design

Problem statement

The condor and hawk Ollama tiers serve models at context lengths below what their GPUs hold. The ollama-48gib tier runs at 128000 tokens while its models support 262144. The ollama-16gib tier runs at 48000 while its model supports 131072. This change raises both values to the maximum the hardware holds and updates the gateway and documentation to match.

Acceptance criteria

Requirement: Condor tier context length

The ollama-48gib profile SHALL set OLLAMA_CONTEXT_LENGTH to 262144.

Scenario: Profile value check

  • WHEN The ollama-48gib DaemonSet manifest is read
  • THEN OLLAMA_CONTEXT_LENGTH equals 262144

Requirement: Hawk tier context length

The ollama-16gib profile SHALL set OLLAMA_CONTEXT_LENGTH to 131072.

Scenario: Profile value check

  • WHEN The ollama-16gib DaemonSet manifest is read
  • THEN OLLAMA_CONTEXT_LENGTH equals 131072

Requirement: Gateway max_input_tokens alignment

The gateway max_input_tokens for routes to ollama-48gib and ollama-16gib SHALL match the tier context lengths.

Scenario: Render test

  • WHEN devops ai gateway render is run against the updated profiles
  • THEN The rendered config shows max_input_tokens of 262144 for the 48gib route and 131072 for the 16gib route

Requirement: Long prompt through gateway

A prompt of more than 140000 tokens through the devops-coder gateway route SHALL receive a model answer.

Scenario: Long prompt acceptance

  • WHEN A prompt of 142214 tokens is sent to the devops-coder route
  • THEN The gateway returns a non-empty model response

Requirement: CI passes

uv run devops ci SHALL pass after the change.

Scenario: CI gate

  • WHEN uv run devops ci is run on the branch
  • THEN All checks complete with a passing status

Existing Tool Considered

No check has run. This change edits the project's own Kubernetes DaemonSet manifests and gateway config. The existing devops ai gateway render command renders the gateway config from the profiles and aligns max_input_tokens with tier context lengths. No external tool or library is needed. The written cost is the tokens to edit two values in k8s/llm/profiles/ollama-profiles.yaml, re-render the gateway config, and update the documentation lines that state the old numbers.

Key questions

  • Which files hold the context length values that must change?: k8s/llm/profiles/ollama-profiles.yaml holds OLLAMA_CONTEXT_LENGTH for each tier. k8s/llm/gateway/config.yaml holds max_input_tokens for the gateway routes. k8s/README.md documents the gateway setup and states the numbers. [sources: k8s/llm/profiles/ollama-profiles.yaml:112, k8s/llm/profiles/ollama-profiles.yaml:257, k8s/llm/profiles/ollama-profiles.yaml:397, k8s/llm/gateway/config.yaml:10, k8s/README.md:120]
  • How is the gateway config rendered from the profiles?: The command devops ai gateway render renders and applies LLM gateway configuration derived from Ollama profiles and service aliases. It aligns max_input_tokens with tier context lengths. The rendered output is a unified diff. [sources: CHANGELOG.md:1222]
  • Should the ollama-48gib-slow tier (hog) also be raised?: No. The body records that Pascal prefill is slow on that tier, so it stays at its current value. (proposed)
    • Rejected: Raise ollama-48gib-slow to 262144. Rejected. Pascal prefill is slow, so the longer context would make calls exceed the client timeout.
    • Chosen: Keep ollama-48gib-slow at its current value. Chosen. The body records that the tier stays because Pascal prefill is slow.
  • Should the ollama-64gib tier (gemini) be changed?: No. The 70B models fill the GPUs at 160000, which is already above their native 131072. The tier stays. (proposed)
    • Rejected: Raise ollama-64gib. Rejected. The 70B models already fill the GPUs at 160000, above their native 131072.
    • Chosen: Keep ollama-64gib at its current value. Chosen. The body records that the tier stays.
  • Does this change fit one pull request?: Yes. The change edits two values in one YAML file, re-renders the gateway config, and updates documentation lines. All of this is a small, cohesive configuration change. (best practice) [sources: k8s/llm/profiles/ollama-profiles.yaml, k8s/llm/gateway/config.yaml, k8s/README.md]
    • Chosen: One PR for both tiers and the gateway render. Chosen. Two value edits, one render, and doc updates form a single cohesive change.
    • Rejected: Split into one PR per tier. Rejected. The change is small and the gateway render depends on both values being set.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/k8s
    status/new
    value/high
    effort/low
    on Oct 31, 2026
  2. dan-petty commented on Oct 31, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. It raises usable context but does not block work or fix a defect.
    • Value: High. Users on condor and hawk gain 2x to 5x more context tokens per request.
    • Effort: Low. The change is a config value update on two tiers plus a gateway render and doc edits; measurements are already done.
    • Related: feat(ai): llm gateway tuning render and apply configuration with rollback #478, which asks for a different change. Both touch gateway max_input_tokens and per-tier Ollama entries, but #478 builds the render mechanism while this candidate changes the actual context values.
  3. added
    priority/p2-medium
    status/in-progress
    and removed
    status/new
    on Oct 31, 2026
  4. removed
    status/in-progress
    on Oct 31, 2026
  5. added a commit that references this issue on Oct 31, 2026
  6. dan-petty commented on Oct 31, 2026

    @dan-petty
    OwnerAuthor

    Check after the sync (2026-10-31):

    • The pods run the new values: ollama-48gib 262144 and ollama-16gib 131072 (OLLAMA_CONTEXT_LENGTH in the pod spec). ollama-48gib-slow stays at 128000 and ollama-64gib at 160000.
    • devops ai gateway tune --model devops-coder --prompt-tokens 150000 --concurrency 1 --rounds 1 --max-tokens 8 sent one prompt of 150000 tokens to qwen3-coder:30b on ollama-48gib-fast: 0 errors, 116 s wall time for the whole request (it includes the model load after the restart), and the four capability probes passed, 4/4 (deep_recall too). Run 20261031T053956Z-c22070.
    • The run started inside the cluster. A call through the Cloudflare tunnel with a cold prompt of this size would be close to its 125 s cut.

    The last acceptance criterion of this issue is met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions