Skip to content

fix(k8s): find why the 16gib-fast qwen3.8 IQ3_S gateway deployment returns HTTP 500 on about 300 calls a day #2368

Closed

Description

@dan-petty

Problem Description

The gateway deployment hf.co/ISTA-DASLab/Qwen3.8-27B-GSQ-RCO-GGUF:IQ3_S on ollama-16gib-fast returned HTTP 500 on 297 calls in 24 h. This is 297 of the 387 deployment failures in that time. The router retries each call on another tier, so a caller often gets a reply. But each failed attempt adds latency and takes a slot. The qwen3.8:27b deployments on ollama-48gib-fast (25) and ollama-64gib-standard (13) also returned HTTP 500 in the same 24 h.

The cause is not known. This issue is to find the cause and then fix it, or file the fix.

Reproduction Steps

  1. Query Prometheus: sum by (api_base, litellm_model_name, exception_status) (increase(litellm_deployment_failure_responses_total[24h])).
  2. Query it in 2 h steps to see the bursts.

Expected vs Actual Behavior

  • Expected: a deployment in the devops-chat and qwen3.8:27b groups replies, or the pre-call check moves a prompt that is too large to another deployment before the call.
  • Actual: the 16gib-fast deployment fails in bursts with HTTP 500.

Environment Diagnostics

devops-cli 0.7.1 (main at 69928b0). Gateway: LiteLLM v1.103.0, k8s/llm/gateway/config.yaml. The deployment has max_input_tokens: 48000 and enable_pre_call_checks: true.

Logs, Traces, or Terminal Output

Measured on 2026-10-27 (litellm_deployment_failure_responses_total, all IQ3_S and qwen3.8:27b deployments, 500 status, 2 h steps, oldest first): 16, 173, 58, 0, 16, 0, 0, 0, 3, 20, 31, 13.

  • A Loki search of {namespace="llm"} for IQ3_S with error, exception or status code in the last 8 h found no line. Thus the gateway log does not show the error text at its log level. Start with the Ollama logs on the ollama-16gib-fast pods at the burst times.
  • One probe call to qwen3.8:27b through the tunnel on 2026-10-27 got HTTP 502 with an HTML body after 31 s. A second call 1 minute later worked. The probe did not keep the body. This can be a different problem.

Questions to answer

Related

Source: #2365

Proposed design

Problem statement

The IQ3_S GGUF deployment on ollama-16gib-fast returns HTTP 500 on about 300 calls per day. The Ollama log shows 42 of 71 errors are chat template prompt error: No user query found in messages, triggered by requests that contain only a system message. The GGUF model has no renderer or parser, so Ollama falls back to the Jinja chat template in the GGUF, which requires a user message. The fix is to create a model from the GGUF with the correct renderer and parser, and point the two gateway deployments at it.

Acceptance criteria

  • Criterion 1: A model created from the IQ3_S GGUF with renderer qwen3.8 and parser qwen3.5 replies to a system-only message without an error.
    Verification: Send a /api/chat request with only a system message to the new model on ollama-16gib-fast and confirm an HTTP 200 reply.
  • Criterion 2: The two IQ3_S deployments in k8s/llm/gateway/config.yaml reference the new model name instead of the raw GGUF path.
    Verification: Read k8s/llm/gateway/config.yaml and confirm both devops-chat and qwen3.8:27b entries for the 16gib-fast tier use the new model name.
  • Criterion 3: k8s/README.md documents the curl create step for the new model next to the existing ollama pull steps.
    Verification: Read k8s/README.md and confirm the create command is present with the model name, from, renderer, parser and parameters.
  • Criterion 4: After deployment, the litellm_deployment_failure_responses_total for the 16gib-fast IQ3_S deployment shows zero template errors over 24 h.
    Verification: Query Prometheus: sum by (api_base, litellm_model_name, exception_status) (increase(litellm_deployment_failure_responses_total[24h])) and confirm no 500 entries for the 16gib-fast IQ3_S deployment.

Key questions

  • What is the Ollama error text for the 500s?: The Ollama log shows chat template prompt error: No user query found in messages. at line 100 of the Jinja chat template in the GGUF. A request with only a system message triggers the 500; a request with a user message works. [sources: k8s/llm/gateway/config.yaml:7]
  • Do the bursts agree with times when another model takes the VRAM of the tier?: No. The 42 template errors are caused by the GGUF chat template rejecting a system-only message, not by VRAM contention from the embedding model. The 27 client-disconnect 500s are the Cloudflare 125 s timeout covered by fix(ai): gateway chat calls stream with keepalive pings, so the Cloudflare 125 s read timeout does not cut a long reply #2365. [sources: k8s/llm/gateway/config.yaml:7]
  • Is the fix a change to max_input_tokens, to the tier profile in k8s/llm/profiles/, or the removal of the deployment from the groups?: The fix is to create a model from the GGUF with renderer qwen3.8, parser qwen3.5 and the library sampling parameters, then point the two IQ3_S deployments in k8s/llm/gateway/config.yaml at the new model. This is neither a max_input_tokens change nor a removal. (proposed) [sources: k8s/llm/gateway/config.yaml:7, k8s/llm/gateway/config.yaml:153]

Fit

Fits in one pull request.

Suspected block

A person must create the model on the ollama-16gib-fast node via the Ollama /api/create endpoint before the config change can be deployed.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    on Oct 27, 2026
  2. dan-petty commented on Oct 27, 2026

    @dan-petty
    OwnerAuthor

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

    • Type: type/bug. The item reports a production failure and asks for a fix.
    • Priority: P1-High.
    • Value: High. Users receive slow or failed calls on a common model.
    • Effort: Medium.
  3. dan-petty commented on Oct 27, 2026

    @dan-petty
    OwnerAuthor

    Findings, 2026-10-27, from the Ollama log of ollama-16gib for the last 30 h (71 HTTP 500 lines):

    • 27 are client disconnects. They took 2m4s: the Cloudflare edge cut the call at 125 s and Ollama logged the cancelled request as a 500. fix(ai): gateway chat calls stream with keepalive pings, so the Cloudflare 125 s read timeout does not cut a long reply #2365 (PR fix(ai): chat calls stream their reply, and the gateway keeps the stream open past the 125 s edge timeout #2379) removes them.
    • 42 are template errors. Ollama logs chat template prompt error: the Jinja chat template inside the GGUF raises No user query found in messages. (line 100 of the template). A direct call to /api/chat of the tier showed the trigger: a request with only a system message gets this 500, and a request with a user message works.
    • The other deployments of the same groups do not fail this way. ollama show qwen3.8:27b --modelfile on ollama-48gib has RENDERER qwen3.8, PARSER qwen3.5 and sampling parameters (temperature 1, top_k 20, top_p 0.95, min_p 0, presence_penalty 0). The hf.co/ISTA-DASLab/Qwen3.8-27B-GSQ-RCO-GGUF:IQ3_S model has only TEMPLATE {{ .Prompt }}, so Ollama 0.34.4 falls back to the Jinja template of the GGUF. With no parser, the reasoning of this deployment is also not split from its content.
    • The callers that send a request with no user message are not the CLI's chat paths: chat, chat_structured and the agent loop always add a user message. The gateway log names the Traefik pod as the client of these requests, so a workstation client or an ingress caller sends them. The router retries them on another deployment, so the caller gets a 200, but each failure counts toward allowed_fails: 3 and can load the 27B model on the 16 GiB card for nothing.

    Proposed fix, not yet applied:

    1. On the 16gib tier, create a model from the GGUF with the renderer, parser and parameters of the library model, through the Ollama API:
      curl http://<ollama-16gib-fast>:11434/api/create -d '{"model":"qwen3.8-gsq:27b-iq3s","from":"hf.co/ISTA-DASLab/Qwen3.8-27B-GSQ-RCO-GGUF:IQ3_S","renderer":"qwen3.8","parser":"qwen3.5","parameters":{"temperature":1,"top_k":20,"top_p":0.95,"min_p":0,"presence_penalty":0,"repeat_penalty":1}}'
    2. Send a request with only a system message to the new model, and confirm that it replies.
    3. Point the two IQ3_S deployments of k8s/llm/gateway/config.yaml at ollama_chat/qwen3.8-gsq:27b-iq3s, and add the create step to the model list of k8s/README.md, next to the ollama pull steps.

    Step 1 changes the model store of the node, so it waits for a person. The change of step 3 waits for step 2: if Ollama does not apply a renderer to this GGUF, the fallback is to remove the IQ3_S deployments from devops-chat and qwen3.8:27b.

  4. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Refine cannot set this item to Ready at 69636b6 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • A person must create the model on the ollama-16gib-fast node via the Ollama /api/create endpoint before the config change can be deployed.
  5. added a commit that references this issue on Oct 28, 2026
    0b76871
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

    source/agenttype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions