- Notifications
You must be signed in to change notification settings - Fork481
Open
Description
Is your feature request related to a problem?
Using LLM models provided by different companies with OpenAI API.
Describe the solution you'd like
For example there are LLM aggregators such as OpenRouter.
You can access it by OpenAI API. Here is an example:
client = OpenAI(
base_url="https://openrouter.ai/api/v1",
api_key=getenv("OPENROUTER_API_KEY"),
)
completion = client.chat.completions.create(
model="openchat/openchat-7b:free",
messages=[
{
"role": "user",
"content": "Say this is a test",
},
],
)
You are allow to provide api_key by OPENAI_API_KEY and base_url by OPENAI_API_ENDPOINT.
But there should be also flexible way to list available models so that you can use them later in the settings.
Maybe even OpenAI API allows to retrieve list of models and this would be awsome to list them.
Additional context
No response