Repository navigation
Give a hand-set LLM provider its own default model - #210
Merged
Merged
Conversation
Setting LLM_PROVIDER (or --llm-provider) without LLM_MODEL kept the Gemini default, so a hand-set anthropic provider, as in a Docker deploy, got a 404. An unset LLM_MODEL now follows the provider, using the models bibr setup already writes (DEFAULT_LLM_MODELS, shared with setup_wizard.LLM_DEFAULTS). An openai provider with LLM_BASE_URL is left alone, since only that server knows its model's name.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
=======================================
Coverage 90.55% 90.56%
=======================================
Files 309 309
Lines 57289 57305 +16
Branches 10376 10379 +3
=======================================
+ Hits 51879 51897 +18
+ Misses 3450 3449 -1
+ Partials 1960 1959 -1 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Jakub · project thread
Before:
LLM_PROVIDER=anthropic(or--llm-provider anthropic) withoutLLM_MODELsent the Gemini default,gemini-3.5-flash-lite, to Anthropic, which answered 404. Every non-Google provider had the same problem.bibr setupalways writesLLM_MODEL, so this hit hand-written envs, such as a Docker deploy.After: an unset
LLM_MODELfollows the provider, using the modelsbibr setupalready writes:claude-haiku-5-5for anthropic,gpt-5-nanofor openai,llama-3.3-70b-versatilefor groq, andgpt-oss:20bfor ollama. AnLLM_MODELyou set yourself is always kept. An openai provider withLLM_BASE_URLkeeps the old default, since bibr can't guess what model a self-hosted server serves.How:
bibr/config.py: a newDEFAULT_LLM_MODELStable and anLlmOptionsvalidator that fillsmodelfrom it whenmodelisn't inmodel_fields_set. The default is kept out ofmodel_fields_set, so a later provider change still treats the model as unset.setup_wizard.LLM_DEFAULTSnow reads its models from the same table.bibr/local/cli/run_config.py:--llm-providerswaps the provider after the settings are built, so it calls the same step again. Presets need nothing extra, because they rebuild the settings through the validators..env.example) and the CHANGELOG describe the new default.LLM_BASE_URLcase, a provider swap, and the CLI flag. The Anthropic adapter tests intest_provider_temperature.pyandtest_anthropic_thinking_caps.pynow pinclaude-haiku-4-5. Without a model, they would get Haiku 5.5, which rejects temperature and budget thinking, the very parameters those tests check.Checks:
ruff check,ruff format --check, andpytest -m "not slow"pass (14,213 passed). The only other failure wastest_rate_limiter.py::test_serial_waiters_are_pacing, a timing test that fails under full-suite load and passes on its own, as noted on #207.Generated by Claude Code