nemo_voice_agent.pipecat.services.nemo.llm
nemo_voice_agent.pipecat.services.nemo.llm
Module Contents
Classes
Functions
Data
API
Bases: LLMUtilsMixin
HuggingFace LLM local service.
Apply the chat template to the messages.
Get the formatted prompt from the conversation history messages. This function also tries to fix the messages if the LLM cannot handle consecutive turns of the same role, or requires a user turn after the system prompt.
Generate a stream of chat completion chunks from the messages.
Bases: OpenAILLMService
LLM service that hosts a HuggingFace model.
Process a context through the LLM and push text frames.
Parameters:
The context to process, containing messages and other information needed for the LLM interaction.
Create a HuggingFaceLLMLocalService client.
Run a one-shot, out-of-pipeline inference against the local HF model.
BaseOpenAILLMService.run_inference calls
self._client.chat.completions.create(...) directly, but our
create_client returns a HuggingFaceLLMLocalService, which
only exposes generate_stream — so the inherited implementation
raises AttributeError here. Nothing called run_inference before
pipecat 1.0; it now backs auto context summarization and the
LLM-turn-completion strategies, so implement it rather than leave a
latent crash behind an opt-in flag.
Utils for local LLM services.
Some LLMs like “nvidia/Llama-3.1-Nemotron-Nano-8B-v1” requires a user turn after the system prompt, this function is used to add a dummy user turn if the system prompt is followed by an assistant turn.
Merge consecutive user turns into a single turn, since some LLMs like “nvidia/Llama-3.1-Nemotron-Nano-8B-v1” do not support consecutive user turns.
Bases: OpenAILLMService, LLMUtilsMixin
LLM service that hosts a vLLM server.
Get a response from the client.
Get a response from the client with reasoning.
Start a vllm server and return the base url.
Stop the vLLM server process if it’s running.
Cancel the LLM service.
Parameters:
The cancel frame.
Get streaming chat completions from the vLLM OpenAI-compatible server.
Parameters:
The LLM context containing messages, tools and tool choice.
Returns: AsyncStream[ChatCompletionChunk]
Async stream of chat completion chunks.
Stop the LLM service.
Parameters:
The end frame.
Get an LLM service from the configuration.