Skip to content

Commit ff006fd

Browse files
committed
Add Hopper LLM provider
Hopper serves open-source models optimized for low time-to-first-token, aimed at voice agents. The API is OpenAI-compatible, so this adds a LLM.with_hopper() factory in the livekit-plugins-openai package alongside the other OpenAI-compatible providers (Cerebras, Together, Nebius, etc.), plus a HopperChatModels type.
1 parent 065e748 commit ff006fd

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

  • livekit-plugins/livekit-plugins-openai/livekit/plugins/openai

livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/llm.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
ChatModels,
4545
CometAPIChatModels,
4646
DeepSeekChatModels,
47+
HopperChatModels,
4748
NebiusChatModels,
4849
OctoChatModels,
4950
OpenRouterProviderPreferences,
@@ -807,6 +808,54 @@ def with_together(
807808
top_p=top_p,
808809
)
809810

811+
@staticmethod
812+
def with_hopper(
813+
*,
814+
model: str | HopperChatModels = "Qwen/Qwen3.6-35B-A3B",
815+
api_key: str | None = None,
816+
base_url: str = "https://api.withhopper.com/v1",
817+
client: openai.AsyncClient | None = None,
818+
user: NotGivenOr[str] = NOT_GIVEN,
819+
temperature: NotGivenOr[float] = NOT_GIVEN,
820+
parallel_tool_calls: NotGivenOr[bool] = NOT_GIVEN,
821+
tool_choice: NotGivenOr[ToolChoice] = NOT_GIVEN,
822+
reasoning_effort: NotGivenOr[ReasoningEffort] = NOT_GIVEN,
823+
safety_identifier: NotGivenOr[str] = NOT_GIVEN,
824+
prompt_cache_key: NotGivenOr[str] = NOT_GIVEN,
825+
top_p: NotGivenOr[float] = NOT_GIVEN,
826+
) -> LLM:
827+
"""
828+
Create a new instance of Hopper LLM (OpenAI-compatible).
829+
830+
Hopper serves open-source models optimized for low time-to-first-token, aimed at
831+
voice agents. See https://withhopper.com.
832+
833+
``api_key`` must be set to your Hopper API key, either using the argument or by setting
834+
the ``HOPPER_API_KEY`` environment variable.
835+
"""
836+
837+
api_key = api_key or os.environ.get("HOPPER_API_KEY")
838+
if api_key is None:
839+
raise ValueError(
840+
"Hopper API key is required, either as argument or set HOPPER_API_KEY environment variable" # noqa: E501
841+
)
842+
843+
return LLM(
844+
model=model,
845+
api_key=api_key,
846+
base_url=base_url,
847+
client=client,
848+
user=user,
849+
temperature=temperature,
850+
parallel_tool_calls=parallel_tool_calls,
851+
tool_choice=tool_choice,
852+
reasoning_effort=reasoning_effort,
853+
safety_identifier=safety_identifier,
854+
prompt_cache_key=prompt_cache_key,
855+
top_p=top_p,
856+
_strict_tool_schema=False,
857+
)
858+
810859
@staticmethod
811860
def with_telnyx(
812861
*,

livekit-plugins/livekit-plugins-openai/livekit/plugins/openai/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@
107107
"google/gemma-2-2b-it",
108108
]
109109

110+
HopperChatModels = Literal["Qwen/Qwen3.6-35B-A3B"]
111+
110112
CerebrasChatModels = Literal[
111113
"llama3.1-8b",
112114
"llama-3.3-70b",

0 commit comments

Comments
 (0)