Skip to content

featherweight.model_settings

model_settings

Which model runs an agent, and how hard it thinks: one typed class per provider.

Each class holds what that provider's models accept, checks it when it is built, and builds the LangChain chat model. To add a provider, or a model, write a subclass (see docs/models.md); the runner only calls build().

ModelInfo

Bases: BaseModel

What one model accepts.

ModelSettings

Bases: BaseModel

Base of the model settings of an agent. A subclass names the provider, lists its models, and writes build().

Frozen, and unknown fields are an error: a setting the class does not declare is one the provider does not take.

check_model_output_schema

check_model_output_schema(
    output_model: type[BaseModel],
) -> None

Refuse an output model that this model cannot fill. Raise ValueError. It is called when an agent is built, so such an agent never reaches the model. A provider's limits are checked by its settings class; the default accepts everything.

label

label() -> str

A short text for the run log: the effort or thinking level.

build

build()

The LangChain chat model. Imports the provider's package here, and raises SetupError when it is missing.

Gemini

Bases: _Google

Gemini 3 and later. Thinking cannot be switched off; minimal is nearly off. No temperature: the model ignores it.

Gemma

Bases: _Google

The Gemma 4 models the Gemini API hosts. Thinking is minimal (off) or high.

With tools and a reply schema in one agent, both models answered at once and skipped the tool where Gemini called it. Prefer Gemma for agents without tools.

Claude

Bases: ModelSettings

Claude 5 and later. effort sets how hard the model thinks, and thinking="off" is for the models that allow it.

The API needs max_tokens, and thinking counts toward it, so it defaults to 16,000. Raise it at xhigh and max. A non-default temperature, top_p or top_k is a 400 on these models, so there are no such fields.

check_model_output_schema

check_model_output_schema(
    output_model: type[BaseModel],
) -> None

The models with native_output get the output as Anthropic's structured output, which does not take every schema. A dictionary would be sent as an object that may hold nothing, and the run would succeed with it empty. A recursive schema, and more than 24 optional fields, are refused by the API.

OpenAI

Bases: ModelSettings

GPT-6 models, through the Responses API (tool calling needs it). effort is reasoning.effort.

No temperature or top_p: the GPT-6.2 guide says to omit them. To add GPT-5.x, subclass and extend models.

require

require(module: str, extra: str) -> Any

Import a provider package when a model is built, and say which extra installs it when it is missing.