Skip to main content

OpenAI (or Compatible) Language Models

To use a language model hosted on OpenAI (or compatible), specify the openai path in from.

For a specific model, include it as the model ID in from (see example below). Defaults to "gpt-3.5-turbo". These parameters are specific to OpenAI models:

ParamDescriptionDefault
openai_api_keyThe OpenAI API key.-
openai_org_idThe OpenAI organization id.-
openai_project_idThe OpenAI project id.-
endpointThe OpenAI API base endpoint.https://api.openai.com/v1

Example:

models:
- from: openai:gpt-4o
name: local_fs_model
params:
openai_api_key: ${ secrets:SPICE_OPENAI_API_KEY }

- from: openai:llama3-groq-70b-8192-tool-use-preview
name: groq-llama
params:
endpoint: https://api.groq.com/openai/v1
openai_api_key: ${ secrets:SPICE_GROQ_API_KEY }