Inference Reference
Python Client
Programmatically inference your finetuned models using the openai package.
- Install the openai python client with
pip install openai
- Create an API key.
- Set your API key with
openai.api_key = '<YOUR_AUTOMORPHIC_API_KEY_HERE>'
. - Get the id of the model you want to inference. You can do this by going to a model’s page and copying the id from the url. For example, the id of the model at
https://automorphic.ai/dashboard/conduit/models/clmq8qfq60000q6kzv3nof4fk
isclmq8qfq60000q6kzv3nof4fk
. Alternately, you can check the settings page of any model to copy the model’s id.
You can start inferencing a finetuned model simply by changing the api_base
to https://api.automorphic.ai/conduit/v1
.
For single-turn conversations (input and output), you can inference a model with:
For multi-turn conversations (chat history), you can inference a model with: