Exports
LiteLLMContext
Stable call context provided to every LiteLLM lifecycle hook.— means no declared default):
Parameters and example
Parameters and example
LiteLLMLifecycle
Customize one LiteLLM model’s transport and call lifecycle. Override hooks with either ordinary orasync methods. Async hooks require
the framework’s async invocation path; Harnest never runs a private event
loop to make them appear synchronous.
Example
Example
LiteLLMLifecycle.create_transport
client option.
Parameters and example
Parameters and example
LiteLLMLifecycle.before_request
request or return its replacement before LiteLLM runs.
Parameters and example
Parameters and example
LiteLLMLifecycle.after_response
Parameters and example
Parameters and example
LiteLLMLifecycle.on_error
Parameters and example
Parameters and example
LiteLLMLifecycle.close
Parameters and example
Parameters and example
LiteLLMModel
A provider-neutral model routed through a framework LiteLLM adapter.model must use LiteLLM’s explicit provider/model form. All keyword
arguments reach the underlying LiteLLM completion call, including provider
settings such as api_base, api_key, and generation options.
thinking selects a portable on/off mode; omit it to use the provider
default or pass reasoning_effort directly for provider-specific levels.
prompt_cache enables provider prompt-cache breakpoints where the
provider requires them; it defaults to True and never changes OpenAI or
Gemini requests.
— means no declared default):
Parameters and example
Parameters and example
LiteLLMModel.build
LiteLlm without contacting the provider.
Example
Example
LiteLLMModel.build_for
Parameters and example
Parameters and example
LiteLLMModel.build_langgraph
Example
Example
LiteLLMModel.from_openai_environment
openai/ prefix selects the wire protocol only.
Parameters and example
Parameters and example
ModelCallRequest
Portable model input that a listener may replace or short-circuit.— means no declared default):
Parameters and example
Parameters and example
ModelCallResponse
Portable visible model output.— means no declared default):
Parameters and example
Parameters and example
ModelConnector
A lazily constructed model with ADK and LangGraph adapters. Connectors keep optional model-provider imports out of config discovery and agent validation. Plain model strings and already-built ADKBaseLlm
objects do not need a connector.
Example
Example
ModelConnector.build
LlmAgent.
Example
Example
ModelConnector.build_for
Parameters and example
Parameters and example
ModelConnector.build_langgraph
Example
Example
ModelLifecycleContext
Stable provider-neutral facts associated with one model call.— means no declared default):
Parameters and example
Parameters and example
ModelLifecycleContext.next
Parameters and example
Parameters and example
ModelLifecycleContext.finish
Parameters and example
Parameters and example
ModelLifecycleError
A portable model listener returned an invalid transformation.Example
Example
ModelMessage
One provider-independent text message in a model call.— means no declared default):
Parameters and example
Parameters and example
resolve_model
Resolve a Harnest connector while preserving strings and ADK models.Parameters and example
Parameters and example
resolve_model_for
Resolve a connector for one compiler backend.Parameters and example
Parameters and example