Skip to main content

Usage guide

Setup, environment variables, and Python/JavaScript/Go usage examples.

SarvamAILLM

Chat completions from Sarvam AI, using your Sarvam key. Good for agents that converse in Indian languages. Authenticates with SARVAMAI_API_KEY from your environment, or an explicit api_key.

Fields

str
default:"UNSET"
Sarvam model name, e.g. “sarvam-105b”. Other hosted models such as “glm5.3” are also accepted. Defaults to ‘sarvam-105b’.
float
default:"UNSET"
Sampling temperature. Lower values give more focused, predictable replies; higher values more varied ones. Defaults to 0.7.
Literal['auto', 'required', 'none']
default:"UNSET"
Whether the model may call tools: “auto” lets it decide, “required” forces a tool call, “none” disables tools. Defaults to ‘auto’.
int | None
default:"UNSET"
Maximum number of tokens in each reply. Defaults to None (not set).
Literal['low', 'medium', 'high', 'max'] | None
default:"UNSET"
How much the model reasons before answering: “low”, “medium”, “high” or “max”. Higher is slower but more thorough. Defaults to None (not set).
bool
default:"UNSET"
Let the model search Wikipedia to ground its answers in facts. Defaults to False.
Optional[int]
default:"UNSET"
Nucleus sampling: only tokens within this cumulative probability mass are considered. An alternative to temperature. Defaults to None (not set).
Optional[float]
default:"UNSET"
Penalizes tokens by how often they have already appeared, reducing repetition. -2.0 to 2.0. Defaults to None (not set).
Optional[float]
default:"UNSET"
Penalizes tokens that have already appeared at all, nudging the model toward new topics. -2.0 to 2.0. Defaults to None (not set).
str | List[str]
default:"UNSET"
Up to 4 sequences that end generation when produced. The stop sequence is not included in the reply. Defaults to None (not set).