openhands.sdk.llm.LLM
instances with the parameters described in this
section. These fields apply identically whether you launch agents through your
own code or via the OpenHands interfaces built on the SDK.
Environment variable layout
The SDK expects environment variables prefixed withLLM_
. They are lowercased
and mapped onto field names when you call LLM.load_from_env()
.
SecretStr
where appropriate.
JSON configuration
For declarative deployments you can persist the SDK model schema to JSON:Commonly tuned parameters
- Latency & retry controls:
timeout
,num_retries
,retry_min_wait
,retry_max_wait
, andretry_multiplier
govern the SDK’s LLM retry behavior across providers. - Prompt shaping:
temperature
,top_p
,top_k
,reasoning_effort
, andextended_thinking_budget
adjust sampling characteristics and Anthropic reasoning budgets. - Cost reporting:
input_cost_per_token
andoutput_cost_per_token
flow into SDK telemetry so downstream interfaces can display usage estimates.
openhands.sdk.llm.LLM
for the full schema. All fields can be set programmatically or via environment
variables using the naming rule field -> LLM_FIELD
.