Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Elevenlabs Elevenlabs python Llm Enum

From Leeroopedia
Revision as of 12:25, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Elevenlabs_Elevenlabs_python_Llm_Enum.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Attribute Value
Sources src/elevenlabs/types/llm.py
Domains Conversational AI, LLM Configuration
Last Updated 2026-02-15

Overview

Description

The Llm type is a union type (not a traditional enum class) that defines the set of supported Large Language Model (LLM) identifiers in the ElevenLabs SDK. It is defined as typing.Union[typing.Literal[...], typing.Any], providing a set of known string literal values for supported LLM models while also accepting any arbitrary string value for forward compatibility. The type includes models from OpenAI (GPT family), Google (Gemini family), Anthropic (Claude family), xAI (Grok), Alibaba (Qwen), and other providers, as well as a special "custom-llm" option for user-provided LLM endpoints.

Usage

The Llm type is used when configuring conversational AI agents in the ElevenLabs platform. It specifies which LLM backend should power the agent's responses. Developers pass one of the supported string literals (or a custom value) when creating or updating an agent configuration. The typing.Any fallback ensures the SDK remains compatible with newly added models that may not yet be listed in the type definition.

Code Reference

Source Location

src/elevenlabs/types/llm.py

Type Definition

Llm = typing.Union[
    typing.Literal[
        "gpt-4o-mini",
        "gpt-4o",
        "gpt-4",
        "gpt-4-turbo",
        "gpt-4.1",
        "gpt-4.1-mini",
        "gpt-4.1-nano",
        "gpt-5",
        "gpt-5.1",
        "gpt-5.2",
        "gpt-5.2-chat-latest",
        "gpt-5-mini",
        "gpt-5-nano",
        "gpt-3.5-turbo",
        "gemini-1.5-pro",
        "gemini-1.5-flash",
        "gemini-2.0-flash",
        "gemini-2.0-flash-lite",
        "gemini-2.5-flash-lite",
        "gemini-2.5-flash",
        "gemini-3-pro-preview",
        "gemini-3-flash-preview",
        "claude-sonnet-4-5",
        "claude-sonnet-4",
        "claude-haiku-4-5",
        "claude-3-7-sonnet",
        "claude-3-5-sonnet",
        "claude-3-5-sonnet-v1",
        "claude-3-haiku",
        "grok-beta",
        "custom-llm",
        # ... plus version-pinned variants
    ],
    typing.Any,
]

Import Statement

from elevenlabs.types import Llm

Type Kind

typing.Union[typing.Literal[...], typing.Any] -- a union of string literals with an Any fallback for forward compatibility.

I/O Contract

The Llm type accepts the following categories of string values:

Provider Model Identifiers (Examples)
OpenAI (GPT) gpt-3.5-turbo, gpt-4, gpt-4-turbo, gpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-5, gpt-5.1, gpt-5.2, gpt-5-mini, gpt-5-nano
Google (Gemini) gemini-1.5-pro, gemini-1.5-flash, gemini-2.0-flash, gemini-2.0-flash-lite, gemini-2.5-flash, gemini-2.5-flash-lite, gemini-3-pro-preview, gemini-3-flash-preview
Anthropic (Claude) claude-sonnet-4-5, claude-sonnet-4, claude-haiku-4-5, claude-3-7-sonnet, claude-3-5-sonnet, claude-3-5-sonnet-v1, claude-3-haiku
xAI (Grok) grok-beta
Alibaba (Qwen) qwen3-4b, qwen3-30b-a3b
Other custom-llm, watt-tool-8b, watt-tool-70b, gpt-oss-20b, gpt-oss-120b, glm-45-air-fp8
Version-pinned Date-stamped variants such as gpt-4o-2024-11-20, claude-sonnet-4@20250514, gemini-2.5-flash-preview-09-2025, etc.
Custom Any string value (via typing.Any fallback) for unlisted or future models.

Usage Examples

from elevenlabs import ElevenLabs
from elevenlabs.types import Llm

client = ElevenLabs(api_key="your_api_key")

# Use a known LLM model identifier
llm_model: Llm = "gpt-4o"

# Use a version-pinned model
llm_model_pinned: Llm = "claude-sonnet-4@20250514"

# Use the custom-llm option for a self-hosted model
llm_custom: Llm = "custom-llm"

# The Any fallback allows future/unlisted models
llm_future: Llm = "some-future-model-v2"

# Typical usage in agent configuration
agent_config = {
    "llm": "gemini-2.5-flash",
    "prompt": "You are a helpful assistant.",
}

Related Pages

  • Voice - Voice model used alongside LLM configuration in conversational AI agents

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment