Skip to content

Bug: shipped Anthropic provider config in providers.json is incompatible with real Claude models #373

Description

@sahiee-dev

Problem

providers.json ships an anthropic provider entry (models claude-opus-4-8, claude-sonnet-5, claude-haiku-4-5) with "structured_output": "json_object", and evaluator.py/pdf.py always send temperature and top_p in the request body. Using a real ANTHROPIC_API_KEY against this config fails on the very first request:

400 {"error":{"code":"invalid_request_error","message":"`temperature` is deprecated for this model.","type":"invalid_request_error","param":null}}

After dropping temperature, top_p also fails the same way:

400 {"error":{"code":"invalid_request_error","message":"`top_p` is deprecated for this model.","type":"invalid_request_error","param":null}}

And response_format.type: "json_object" is rejected outright:

400 {"error":{"code":"invalid_request_error","message":"response_format.type: Input should be 'json_schema'","type":"invalid_request_error","param":null}}

Switching to "json_schema" then requires a strict flag and a schema with additionalProperties: false set recursively — which EvaluationData.model_json_schema() (a plain Pydantic export) doesn't produce, so that path also 400s:

400 {"error":{"code":"invalid_request_error","message":"response_format.json_schema.schema: For 'object' type, 'additionalProperties' must be explicitly set to false","type":"invalid_request_error","param":null}}

Net effect: the anthropic entry in providers.json cannot currently complete a single request end-to-end against the real API.

Repro

DEFAULT_MODEL=claude-sonnet-5
ANTHROPIC_API_KEY=<real key>
python score.py ./resume/sample.pdf

Fails with the 400 above on both the GitHub-project-selection call and the final evaluation call.

Fix that worked

  • Added a supports_temperature flag (default true) to the provider config, threaded through config.provider_for()llm_utils.initialize_llm_provider()OpenAICompatibleProvider, and skip sending temperature/top_p when it's false.
  • Set "structured_output": "none" for the anthropic entry so no response_format is sent at all — the existing prompt-only JSON instructions (and extract_json_from_response's markdown-fence stripping) are enough; claude-sonnet-5 follows them reliably.

With those two changes, a full score.py run completes end-to-end against real claude-sonnet-5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions