-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Everyone is using the OpenAI API. Hence, we want to have a generic OpenAI API provider that enables one to use custom endpoints even if we don't have a native provider for that endpoint.
We use go-openai which allows to adapt to an endpoint via:
- specifying a custom endpoint URL (which we already do internally for openrouter.ai)
- specifying an access token (which is used as HTTP header for authentification)
- specifying the model one wants to query...
To use our new generic OpenAI API provider, we need to make these options available via the CLI, i.e.:
eval-dev-quality evaluate \
--urls custom-provider-a:https://a.example.com/api,custom-provider-b:https://b.example.com/api
--tokens custom-provider-a:abcdefg,custom-provider-b:scdefgh
--model custom-provider-a/modelA
--model custom-provider-b/modelBInternally, this should be implemented as follows:
- add generic
provider/openai-apiAPI provider with custom url, token +[]Model - before evaluation
- go through CLI argument
urlsand look at the ones with thecustom-prefix:provider.Register(openaiapi.NewProvider(<url>, <name>)) - go through CLI arguments
modeland add the models to their matching custom provider's[]Model
- go through CLI argument
- token injection should work automatically since the generic providers are registered properly
- test this with i.e. an
Ollamamodel because we haveOllama(soon Ollama provider #27) - refactor the existing
openrouter.aiandOllamaproviders so they internally use this generic provider as base
- Q: But with this approach we are skipping the actually model querying because we are always blindly registering the models that are specified in the CLI 😠.
- A: Yes but sadly we cannot be sure the endpoint supports model querying (i.e. Ollama supports only the OpenAI API prompt querying but not the model listing API). So for now just trust that the models exist. Maybe we can add the check in the future but then need to add a way to disable again for cases like Ollama.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request