dazzling-truck-32153
09/23/2025, 8:25 PMtall-airline-16756
09/23/2025, 8:25 PMtall-airline-16756
09/23/2025, 8:26 PMopenai.LLM.with_groq(). There are also other great options like Azure, Cerebras, and Perplexity that you might find helpful.
2. Override the llm_node() Method: For a fully custom LLM, you can override the llm_node() method in your agent class. This gives you the flexibility to add your own logic for LLM inference while keeping everything compatible with your pipeline.
3. Leverage Dataclasses: Using dataclasses such as ModelSettings is a neat way to configure your LLM parameters and manage state smoothly.
4. Advanced Control: If you want more detailed control, the perform_llm_inference function is there for you to fine-tune the integration exactly how you need.
Please don’t hesitate to reach out if you’d like some detailed examples or any further help with these steps—I’m here to support you!
Sources: OpenAI compatible LLMs | LiveKit Docs | OpenAI compatible LLMs | LiveKit Docs | examples/other/translation/multi-user-translator.py | Pipeline nodes and hooks | LiveKit Docsdazzling-truck-32153
09/23/2025, 8:27 PMtall-airline-16756
09/23/2025, 8:28 PMwith_groq() or with_cerebras(). While these LLMs do use OpenAI-compatible APIs, the integration is designed for those predefined in the plugin to ensure everything runs smoothly.
Right now, supported LLMs include Azure OpenAI, Cerebras, Groq, Perplexity, and a few others. Each one has its own hardcoded base URL and authentication setup, so unfortunately, arbitrary OpenAI-compatible LLMs can’t be used unless they’re explicitly added to the plugin.
If you have a particular LLM in mind, I’m here to help! I can check if it’s supported or guide you through extending the plugin for a custom integration. Just let me know how you’d like to move forward—I’m happy to assist!
Sources: LiveKit integration guides | LiveKit Docs | OpenAI compatible LLMs | LiveKit Docs | OpenAI compatible LLMs | LiveKit Docs | plugins/openai/src/llm.ts | livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/__init__.pydazzling-truck-32153
09/23/2025, 8:29 PMtall-airline-16756
09/23/2025, 8:29 PMdazzling-truck-32153
09/23/2025, 8:31 PMtall-airline-16756
09/23/2025, 8:31 PMwith_groq() or with_cerebras(), which have built-in base URLs and authentication.
To connect with MoonshotAI directly, you have a couple of friendly options:
1. You could modify the LiveKit plugin by adding a dedicated with_moonshot() method, similar to the ones already there. This would mean forking the plugin and including Moonshot’s base URL and API key handling.
2. Alternatively, you can override the llm_node() method in your agent class to manually integrate MoonshotAI. This way, you’d bypass the plugin and use Moonshot’s OpenAI-compatible API directly.
I’d be happy to walk you through either of these options step-by-step. Just let me know which path sounds best for you, and we’ll take it from there!dazzling-truck-32153
09/23/2025, 8:32 PMtall-airline-16756
09/23/2025, 8:32 PMwith_moonshot() method! To do this, you'll want to update the LiveKit OpenAI plugin to support MoonshotAI as a provider. Here's a friendly step-by-step guide to get you started:
1. Fork the Plugin: Begin by cloning the LiveKit OpenAI plugin repository to your local setup.
2. Add the Method: Next, create a new static method called with_moonshot() inside the plugin's LLM class. This method will set Moonshot's base URL and handle fetching the API key. Here's an example you can follow:
class LLM:
@staticmethod
def with_moonshot(opts: dict = None) -> LLM:
opts = opts or {}
opts['api_key'] = opts.get('api_key') or os.getenv('MOONSHOT_API_KEY')
if not opts['api_key']:
raise ValueError("Moonshot API key is required")
return LLM(
model=opts.get('model', 'default-model'),
base_url=os.getenv('MOONSHOT_BASE_URL'),
api_key=opts['api_key'],
**opts
)
1. Test the Integration: Give the new with_moonshot() method a try in your voice processing pipeline to make sure everything runs smoothly.
2. Deploy: Once you're happy with it, you can use your updated plugin in your project or even submit a pull request to the official repository so others can benefit too.
This process assumes you're comfortable with Python and familiar with the plugin’s codebase, but please don’t hesitate to ask if you’d like me to walk you through any part or provide more examples. I’m here to help!