how can i use my own llm for `AgentSession`
# ask-ai
n
how can i use my own llm for
AgentSession
t
Thanks for reaching out, Mohamed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can use your own LLM (Large Language Model) with
AgentSession
in several ways, depending on how your LLM is deployed and accessible: • Ollama for Local Models: If your model runs locally and exposes an OpenAI-compatible API (such as via Ollama), you can use the OpenAI plugin. Specify your model name and the base URL for your local API endpoint in the configuration. • LangChain Integration: If you have a custom LLM workflow using LangChain or LangGraph, use the LangChain plugin. Create your workflow graph and pass it to the
LLMAdapter
for integration with
AgentSession
. • Provider with Custom Model Support: Some providers, like Amazon Bedrock, support custom models. You can specify your custom model name when configuring the provider plugin for
AgentSession
. • Custom LLM Node: For full customization, implement your own LLM node by creating a class that follows the LLM interface pattern and pass it to
AgentSession
. Choose the approach that matches your LLM deployment. The Ollama and LangChain integrations are the most common for local and custom workflows, respectively. Sources: Ollama integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-langchain/README.md | Large language model (LLM) integrations | LiveKit Docs