Repository: livekit/agents
File: livekit-agents/livekit/agents/inference/llm.py (Python)

Code before:

lk_oai_debug = int(os.getenv("LK_OPENAI_DEBUG", 0))


OpenAIModels = Literal[
    "openai/gpt-5",
    "openai/gpt-5-mini",
    "openai/gpt-5-nano",
    "openai/gpt-4.1",
    "openai/gpt-4.1-mini",
    "openai/gpt-4.1-nano",
    "openai/gpt-4o",
    "openai/gpt-4o-mini",
]

GoogleModels = Literal[
    "google/gemini-2.5-pro",
    "google/gemini-2.5-flash",
    "google/gemini-2.5-flash-lite",
    "google/gemini-2.0-flash",
    "google/gemini-2.0-flash-lite",
]

QwenModels = Literal["qwen/qwen3-235b-a22b-instruct"]

KimiModels = Literal["moonshotai/kimi-k2-instruct"]

DeepSeekModels = Literal["deepseek-ai/deepseek-v3"]

LLMModels = Union[OpenAIModels, GoogleModels, QwenModels, KimiModels, DeepSeekModels]


class ChatCompletionOptions(TypedDict, total=False):
    frequency_penalty: Optional[float]
    logit_bias: Optional[dict[str, int]]
    logprobs: Optional[bool]
    max_completion_tokens: Optional[int]
    max_tokens: Optional[int]
    metadata: Optional[Metadata]
    modalities: Optional[list[Literal["text", "audio"]]]
    n: Optional[int]
    parallel_tool_calls: bool
    prediction: Optional[ChatCompletionPredictionContentParam]
    presence_penalty: Optional[float]
    prompt_cache_key: str
    reasoning_effort: Optional[ReasoningEffort]
    safety_identifier: str
    seed: Optional[int]
    service_tier: Optional[Literal["auto", "default", "flex", "scale", "priority"]]
    stop: Union[Optional[str], list[str], None]
    store: Optional[bool]

Review comment (suggestion):
`gpt-oss-120b` is still support on baseten as `openai/gpt-oss-120b`

https://docs.google.com/spreadsheets/d/1RhLAgmOhtrIRYeL1OLVrkCt73ZY8C3k0n5NNRvUolTg/edit?gid=561069390#gid=561069390

Code after:


OpenAIModels = Literal[
    "openai/gpt-5",
    "openai/gpt-5-mini",
    "openai/gpt-5-nano",
    "openai/gpt-4.1",
    "openai/gpt-4.1-mini",
    "openai/gpt-4.1-nano",
    "openai/gpt-4o",
    "openai/gpt-4o-mini",
    "openai/gpt-oss-120b",
]

GoogleModels = Literal[
    "google/gemini-2.5-pro",
    "google/gemini-2.5-flash",
    "google/gemini-2.5-flash-lite",
    "google/gemini-2.0-flash",
    "google/gemini-2.0-flash-lite",
]

QwenModels = Literal["qwen/qwen3-235b-a22b-instruct"]

KimiModels = Literal["moonshotai/kimi-k2-instruct"]

DeepSeekModels = Literal["deepseek-ai/deepseek-v3"]

LLMModels = Union[OpenAIModels, GoogleModels, QwenModels, KimiModels, DeepSeekModels]


class ChatCompletionOptions(TypedDict, total=False):
    frequency_penalty: float | None
    logit_bias: dict[str, int] | None
    logprobs: bool | None
    max_completion_tokens: int | None
    max_tokens: int | None
    metadata: Metadata | None
    modalities: list[Literal["text", "audio"]] | None
    n: int | None
    parallel_tool_calls: bool
    prediction: ChatCompletionPredictionContentParam | None
    presence_penalty: float | None
    prompt_cache_key: str
    reasoning_effort: ReasoningEffort | None
    safety_identifier: str
    seed: int | None
    service_tier: Literal["auto", "default", "flex", "scale", "priority"] | None
    stop: str | None | list[str] | None
    store: bool | None
    temperature: float | None