Skip to content

Direct any model (named without claude-) to the OpenAI backend. #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2024

Conversation

namin
Copy link
Contributor

@namin namin commented Oct 6, 2024

The old logic (OpenAI backend only for gpt- names) directed any OpenAI-compatible server model configuration to the Claude backend, as it was picked by default for any model named without gpt-.

It is easier to just switch the default backend, rather than considering whether the environment variable OPENAI_BASE_URL is set.

I confirmed the fix on the following run:

  • Use Ollama: export OPENAI_BASE_URL="http://localhost:11434/v1"
  • Set dummy OpenAI key: export OPENAI_API_KEY="ollama"
  • Run README command with extra agent parameters: aide agent.code.model="qwen2.5" agent.feedback.model="qwen2.5" data_dir="example_tasks/house_prices" goal="Predict the sales price for each house" eval="Use the RMSE metric between the logarithm of the predicted and observed values."

The old logic (OpenAI backend only for `gpt-` names) directed any
OpenAI-compatible server model configuration to the Claude backend,
as it was picked by default for any model named without `gpt-`.

It is easier to just switch the default backend, rather than
considering whether the environment variable `OPENAI_BASE_URL` is set.

I confirmed the fix on the following run:
- Use Ollama: `export OPENAI_BASE_URL="http://localhost:11434/v1"`
- Set dummy OpenAI key: `export OPENAI_API_KEY="ollama"`
- Run README command with extra `agent` parameters:
  `aide agent.code.model="qwen2.5" agent.feedback.model="qwen2.5" data_dir="example_tasks/house_prices" goal="Predict the sales price for each house" eval="Use the RMSE metric between the logarithm of the predicted and observed values."`
@ZhengyaoJiang
Copy link
Collaborator

Thanks for the contribution!

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.

2 participants