Skip to content

fix(cli): apply --api-base to the configured models - #588

Open
Alvi-Rahman wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
Alvi-Rahman:fix/cli-api-base-override
Open

Alvi-Rahman wants to merge 1 commit into
algorithmicsuperintelligence:mainfrom
Alvi-Rahman:fix/cli-api-base-override

Conversation

@Alvi-Rahman

Copy link
Copy Markdown

--api-base on its own has no effect. It sets config.llm.api_base, but each model already copied its api_base when the config was loaded, and OpenAILLM uses the per-model value. With a config like

llm:
  models:
    - name: "gpt-4o-mini"

--api-base http://localhost:8000/v1 still sends every request to https://api.openai.com/v1. It only works if --primary-model or --secondary-model is passed too, since those rebuild the models.

The flag now updates api_base on every model, overwriting the config file value like the model flags do.

Tests: one case in tests/test_cli_model_override.py that runs main_async with only --api-base. It fails on main ('https://api.openai.com/v1' != 'http://localhost:8000/v1'). Full suite: 1070 tests, OK.

--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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant