llm-connect/llm_connect
tegwick 1b01f0edf4 Honour explicit OpenRouter --model when it equals the adapter default
The adapter compared self._model to _DEFAULT_MODEL ("anthropic/claude-sonnet-4")
to decide whether to honour the constructor's model. When a caller passes
that exact value via --model, the comparison treats it as "not specified"
and falls through to RunConfig.model_name, which defaults to "gpt-4". So
every llm-connect call started with --provider openrouter --model
anthropic/claude-sonnet-4 actually landed on OpenAI's gpt-4 — and on
gpt-4 OpenAI's structured-output response_format requires a model with
schema support that gpt-4 lacks, returning 400. The CUST-WP-0045 canary
hit this for hours; the smoke probes that worked were the ones with no
json_schema, where gpt-4 returned fine.

Track _explicit_model separately so a constructor or LLMConfig that
matches the default is still treated as a real intent.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 14:50:37 +02:00
..
__init__.py Implement-LLM-WP-0005-cost-model-estimators 2026-05-19 05:02:20 +02:00
_http.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00
_token_estimator.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00
adapter.py refactor: simplify post-WP-0002 cleanup 2026-04-01 22:30:00 +00:00
claude_code.py Prefer JSON-bearing envelope fields, skip metadata, in Claude CLI unwrap 2026-06-02 12:44:25 +02:00
cli.py Implement-LLM-WP-0005-cost-model-estimators 2026-05-19 05:02:20 +02:00
config.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00
costs.py Implement-LLM-WP-0005-cost-model-estimators 2026-05-19 05:02:20 +02:00
embedding_adapter.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00
embedding_cache.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00
embedding_factory.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00
embedding_openai.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00
exceptions.py refactor: simplify post-WP-0002 cleanup 2026-04-01 22:30:00 +00:00
factory.py feat: WP-0003 — RoutingPolicy (FR-2) and HTTP serve mode (FR-1) 2026-04-01 22:34:00 +00:00
gemini.py refactor: simplify post-WP-0002 cleanup 2026-04-01 22:30:00 +00:00
grading.py Add adaptive cost-quality routing primitives 2026-05-17 21:32:27 +02:00
models.py refactor: simplify post-WP-0002 cleanup 2026-04-01 22:30:00 +00:00
openai.py refactor: simplify post-WP-0002 cleanup 2026-04-01 22:30:00 +00:00
openrouter.py Honour explicit OpenRouter --model when it equals the adapter default 2026-06-02 14:50:37 +02:00
problem_classes.py Implement-LLM-WP-0005-cost-model-estimators 2026-05-19 05:02:20 +02:00
quality.py Add adaptive cost-quality routing primitives 2026-05-17 21:32:27 +02:00
rates.py Implement-LLM-WP-0005-cost-model-estimators 2026-05-19 05:02:20 +02:00
routing.py Add adaptive cost-quality routing primitives 2026-05-17 21:32:27 +02:00
server.py Preserve llm-connect run config in server mode 2026-05-19 20:55:02 +02:00
shadowing.py Add adaptive cost-quality routing primitives 2026-05-17 21:32:27 +02:00
similarity.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00
toml_config.py feat: initial llm-connect package scaffold 2026-02-27 07:54:42 +01:00