Repository navigation
fix(cli): apply --api-base to the configured models - #588
Open
Alvi-Rahman wants to merge 1 commit into
Open
Alvi-Rahman wants to merge 1 commit into
Alvi-Rahman wants to merge 1 commit into
Conversation
--api-base only set llm.api_base. The models had already copied their api_base from the config file, and requests use the per-model value, so unless --primary-model or --secondary-model was also passed (which rebuilds the models) every request still went to the old base URL.
This branch has not been deployed
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.
--api-baseon its own has no effect. It setsconfig.llm.api_base, but each model already copied itsapi_basewhen the config was loaded, andOpenAILLMuses the per-model value. With a config like--api-base http://localhost:8000/v1still sends every request tohttps://api.openai.com/v1. It only works if--primary-modelor--secondary-modelis passed too, since those rebuild the models.The flag now updates
api_baseon every model, overwriting the config file value like the model flags do.Tests: one case in
tests/test_cli_model_override.pythat runsmain_asyncwith only--api-base. It fails onmain('https://api.openai.com/v1' != 'http://localhost:8000/v1'). Full suite: 1070 tests, OK.