✗ WRONG

any-llm 1.40.2

request.max-tokens-ollama-openai · ollama-openai

Back to results · Scenario

Requirements

IdLevelStatusEvidence
limit-fieldMUSTCONTRADICTEDrequest[0].json_body.max_tokens=absent; required=16

What the provider sent

Finish
length
Raw finish
length
Text
Here are three moons of Jupiter: 1. **Callisto** (
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": 0,
  "input": 18,
  "output": 16,
  "raw": {
    "completion_tokens": 16,
    "prompt_tokens": 18,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "total_tokens": 34
  },
  "reasoning": null,
  "total": 34
}
Stream completed
null
Error
null
Wire excerpt
status: 200
content-type: application/json
body (json):
{
  "id": "chatcmpl-390",
  "object": "chat.completion",
  "created": 1791831669,
  "model": "qwen3.5:0.8b",
  "system_fingerprint": "fp_ollama",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Here are three moons of Jupiter:\n\n1.  **Callisto** ("
      },
      "finish_reason": "length"
    }
  ],
  "usage": {
    "prompt_tokens": 18,
    "prompt_tokens_details": {
      "cached_tokens": 0
    },
    "completion_tokens": 16,
    "total_tokens": 34
  }
}

What the library reported

Outcome
returned
Finish
{
  "raw": "length",
  "source": "choices[0].finish_reason",
  "surface": "primary",
  "value": "length"
}
Text
Value
Here are three moons of Jupiter: 1. **Callisto** (
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 18,
  "output": 16,
  "reasoning": null,
  "surface": {
    "cached_input": "primary",
    "input": "primary",
    "output": "primary",
    "reasoning": "absent",
    "total": "primary"
  },
  "total": 34
}
Stream
{
  "chunks_seen": null,
  "completed": null,
  "used": false
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 148.5037049278617,
  "error": null,
  "finish": {
    "raw": "length",
    "source": "choices[0].finish_reason",
    "surface": "primary",
    "value": "length"
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "any_llm.completion",
    "language": "python",
    "name": "any-llm",
    "version": "1.40.2"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": null,
    "completed": null,
    "used": false
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "primary",
    "value": "Here are three moons of Jupiter:\n\n1.  **Callisto** ("
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 0,
    "input": 18,
    "output": 16,
    "reasoning": null,
    "surface": {
      "cached_input": "primary",
      "input": "primary",
      "output": "primary",
      "reasoning": "absent",
      "total": "primary"
    },
    "total": 34
  }
}

Fixture

recorded ollama-openai/request.max-tokens-ollama-openai

ProvenanceValue
Recorded at2026-10-12T19:01:09Z
Requested modelqwen3.5:0.8b
Returned modelqwen3.5:0.8b
CI runhttps://github.com/kartsan03/wiretruth/actions/runs/38294739276

Reproduce

wiretruth serve ollama-openai/request.max-tokens-ollama-openai

Plain-library snippet from the shim manifest.

any_llm.completion(model=model, provider='openai', api_base=WIRETRUTH_BASE_URL_OLLAMA_OPENAI, api_key=WIRETRUTH_API_KEY)

Upstream

reported Issue · PR

Fixed in: not specified

Existing upstream issue, not opened by wiretruth. Ollama's OpenAI-compatible endpoint ignores max_completion_tokens (v0.40.3), and any-llm's openai provider sends only that name (providers/openai/base.py), so the limit never applies. The root cause is in Ollama; the PR listed adds the field. The check reads the request any-llm sends, so the cell stays WRONG after Ollama's fix and re-recording does not change it: retire or rewrite the scenario when that release ships.

History

VersionGrade
1.40.2✗ WRONG
1.38.0✗ WRONG
1.33.0✗ WRONG