Integrate Your Own Model
Guide for using your own LLM or server with ElevenLabs SDK.
Using Your Own OpenAI Key for LLM
To integrate a custom OpenAI key, create a secret containing your OPENAI_API_KEY:
Navigate to the “Secrets” page and select “Add Secret”
Choose “Custom LLM” from the dropdown menu.
Enter the URL, your model, and the secret you created.
Set “Custom LLM extra body” to true.
Custom LLM Server
To bring a custom LLM server, set up a compatible server endpoint using OpenAI’s style, specifically targeting create_chat_completion.
Here’s an example server implementation using FastAPI and OpenAI’s Python SDK:
Run this code or your own server code.
Setting Up a Public URL for Your Server
To make your server accessible, create a public URL using a tunneling tool like ngrok:
Configuring Elevenlabs CustomLLM
Now let’s make the changes in Elevenlabs
Direct your server URL to ngrok endpoint, setup “Limit token usage” to 5000 and set “Custom LLM extra body” to true.
You can start interacting with Conversational AI with your own LLM server
Additional Features
Was this page helpful?