✓ PASS

any-llm 1.40.2

finish.unknown-value · ollama-openai

Back to results · Scenario

Requirements

IdLevelStatusEvidence
response-returnedMUSTSATISFIEDoutcome=returned; error.category=null; truth.error=null
finish-is-otherMUSTSATISFIEDfinish.value="other" (primary: choices[0].finish_reason); truth.finish="other"; required finish="other"
text-reportedMUSTSATISFIEDtext.value="Octopuses, like many marine invertebrates, employ sophisticated methods to camouflage" (primary); truth.text="Octopuses, like many marine invertebrates, employ sophisticated methods to camouflage"
raw-finish-reportedSHOULDSATISFIEDfinish.raw="wiretruth_unknown_reason"; truth.raw_finish="wiretruth_unknown_reason"

What the provider sent

Finish
other
Raw finish
wiretruth_unknown_reason
Text
Octopuses, like many marine invertebrates, employ sophisticated methods to camouflage
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": 28,
  "input": 32,
  "output": 16,
  "raw": {
    "completion_tokens": 16,
    "prompt_tokens": 32,
    "prompt_tokens_details": {
      "cached_tokens": 28
    },
    "total_tokens": 48
  },
  "reasoning": null,
  "total": 48
}
Stream completed
null
Error
null
Wire excerpt
status: 200
content-type: application/json
body (json):
{
  "id": "chatcmpl-54",
  "object": "chat.completion",
  "created": 1791831683,
  "model": "qwen3.5:0.8b",
  "system_fingerprint": "fp_ollama",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Octopuses, like many marine invertebrates, employ sophisticated methods to camouflage"
      },
      "finish_reason": "wiretruth_unknown_reason"
    }
  ],
  "usage": {
    "prompt_tokens": 32,
    "prompt_tokens_details": {
      "cached_tokens": 28
    },
    "completion_tokens": 16,
    "total_tokens": 48
  }
}

What the library reported

Outcome
returned
Finish
{
  "raw": "wiretruth_unknown_reason",
  "source": "choices[0].finish_reason",
  "surface": "primary",
  "value": "other"
}
Text
Value
Octopuses, like many marine invertebrates, employ sophisticated methods to camouflage
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 28,
  "input": 32,
  "output": 16,
  "reasoning": null,
  "surface": {
    "cached_input": "primary",
    "input": "primary",
    "output": "primary",
    "reasoning": "absent",
    "total": "primary"
  },
  "total": 48
}
Stream
{
  "chunks_seen": null,
  "completed": null,
  "used": false
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 135.89796889573336,
  "error": null,
  "finish": {
    "raw": "wiretruth_unknown_reason",
    "source": "choices[0].finish_reason",
    "surface": "primary",
    "value": "other"
  },
  "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": "Octopuses, like many marine invertebrates, employ sophisticated methods to camouflage"
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 28,
    "input": 32,
    "output": 16,
    "reasoning": null,
    "surface": {
      "cached_input": "primary",
      "input": "primary",
      "output": "primary",
      "reasoning": "absent",
      "total": "primary"
    },
    "total": 48
  }
}

Fixture

derived ollama-openai/finish.unknown-value

ProvenanceValue
Transformreplace_finish_value
Source fixtureollama-openai/truncation.text
RationaleThe provider sends a finish value that a library may not recognize.
Evidencehttps://github.com/BerriAI/litellm/issues/21347

Reproduce

wiretruth serve ollama-openai/finish.unknown-value

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

released Issue · PR

Fixed in: 1.38.0

A finish_reason outside OpenAI's five values raises a pydantic ValidationError (ChatCompletion.model_validate), so the response is lost. Also reproduced on 1.33.3. The same error reaches provider='openai' pointed at Ollama's OpenAI-compatible endpoint (ollama-openai). Fixed by a third-party PR (#1504); both cells PASS on 1.38.0.

History

VersionGrade
1.40.2✓ PASS
1.38.0✓ PASS
1.33.0✗ WRONG