https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do the custom variables work with a custom llm
# ❓・ai-evy-support
m
@AI Evy how do the custom variables work with a custom llm?
a
Thanks for tagging me @MrG#1803. I'll look through relevant sources and get back to you shortly.
### Answer When using a custom LLM, dynamic variables are passed via the
retell_llm_dynamic_variables
parameter when registering or creating a call. [(1) ]() [(2) ]() For example, when registering a phone call:
Copy code
json
{
  "retell_llm_dynamic_variables": {
    "customer_name": "John Doe"
  }
}
[(1) ]() These key-value pairs are then available to inject into your custom LLM's prompt and tool descriptions. [(1) ]() [(2) ]() With a custom LLM websocket integration, you would receive these variables as part of the call context and manually interpolate them into your prompt. The
RetellRequest
object sent to your websocket contains the transcript and interaction type, and you'd build your prompt using the dynamic variables you received at call registration time. [(3) ]() The actual injection into your prompt is your responsibility when using a custom LLM—you handle the variable substitution in your
PreparePrompt
function or equivalent.
​ To learn more, see the sources I considered: [[1] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[2] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[3] Integrate LLM](https://docs.retellai.com/integrate-llm/integrate-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.