Skip to content

How to set and use properly configuration file? #377

Closed Answered by ErikBjare
aborruso asked this question in Q&A
Discussion options

You must be logged in to vote

If I set the API key for multiple models, which one is used as the default model? Do I have to comment them all out and leave only one free?

If no model is set, it will try to detect a provider with keys configured:

gptme/gptme/llm/__init__.py

Lines 273 to 293 in 54253a5

def guess_model_from_config() -> Provider | None:
"""
Guess the model to use from the configuration.
"""
config = get_config()
if config.get_env("OPENAI_API_KEY"):
console.log("Found OpenAI API key, using OpenAI provider")
return "openai"
elif config.get_env("ANTHROPIC_API_KEY"):
console.log("Found Anthropic API key, using Anthropic provider")
return

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@aborruso
Comment options

@ErikBjare
Comment options

@aborruso
Comment options

Answer selected by ErikBjare
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants