glean/models/anthropic

Current Anthropic Claude models.

These models choose their own sampling: the API rejects temperature, top_p and top_k, so this builder doesn’t offer them. Thinking is adaptive; set its depth with reasoning_effort (sent as output_config.effort).

For older Claude models that still take sampling parameters, see glean/models/anthropic_sampling.

Types

A Claude model builder. Pick a model with one of the constructors (or custom), chain setters, then call build().

pub opaque type Claude

Values

pub fn build(m: Claude) -> model.Model

Build a Model to use with agent.new.

pub fn configure(
  m: Claude,
  f: fn(config.ProviderConfig) -> config.ProviderConfig,
) -> Claude

Change the provider configuration: base URL, timeout, headers, retries.

|> configure(config.timeout(_, 120_000))
pub fn custom(
  api_key key: String,
  model model_id: String,
) -> Claude

Any other model ID served by this API, such as one released after this version of glean. Only this module’s setters are available, so check the model accepts them.

pub fn fable_5(api_key key: String) -> Claude

Claude Fable 5. Model ID: claude-fable-5.

pub fn fable_5_1(api_key key: String) -> Claude

Claude Fable 5.1, the most capable widely released Claude model. Rejects forced tool choice. Model ID: claude-fable-5-1.

pub fn haiku_5_5(api_key key: String) -> Claude

Claude Haiku 5.5. Model ID: claude-haiku-5-5.

pub fn max_output_tokens(m: Claude, n: Int) -> Claude

Set the maximum number of output tokens.

pub fn opus_4_7(api_key key: String) -> Claude

Claude Opus 4.7. Model ID: claude-opus-4-7.

pub fn opus_4_8(api_key key: String) -> Claude

Claude Opus 4.8. Model ID: claude-opus-4-8.

pub fn opus_5(api_key key: String) -> Claude

Claude Opus 5. Model ID: claude-opus-5.

pub fn opus_5_5(api_key key: String) -> Claude

Claude Opus 5.5. Rejects forced tool choice. Model ID: claude-opus-5-5.

pub fn reasoning_effort(
  m: Claude,
  effort: provider.ReasoningEffort,
) -> Claude

Set how much the model should think before answering.

pub fn sonnet_5(api_key key: String) -> Claude

Claude Sonnet 5. Model ID: claude-sonnet-5.

pub fn sonnet_5_5(api_key key: String) -> Claude

Claude Sonnet 5.5. Rejects forced tool choice. Model ID: claude-sonnet-5-5.

pub fn stop_sequences(m: Claude, stops: List(String)) -> Claude

Stop generating when the model writes any of these strings.

✨ Search Document