glean/models/qwen

Alibaba Qwen models (DashScope, international endpoint).

Hybrid thinking models take enable_thinking; set it with configure(config.extra_body_field(_, "enable_thinking", json.bool(True))). For the China endpoint or a workspace URL, set config.base_url.

Types

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

pub opaque type Qwen

Values

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

Build a Model to use with agent.new.

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

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,
) -> Qwen

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 max_output_tokens(m: Qwen, n: Int) -> Qwen

Set the maximum number of output tokens.

pub fn qwen3_5_flash(api_key key: String) -> Qwen

Qwen3.5 Flash. Model ID: qwen3.5-flash.

pub fn qwen3_5_plus(api_key key: String) -> Qwen

Qwen3.5 Plus. Model ID: qwen3.5-plus.

pub fn qwen3_7_plus(api_key key: String) -> Qwen

Qwen3.7 Plus. Model ID: qwen3.7-plus.

pub fn qwen3_8_flash(api_key key: String) -> Qwen

Qwen3.8 Flash. Model ID: qwen3.8-flash.

pub fn qwen3_8_max(api_key key: String) -> Qwen

Qwen3.8 Max. Model ID: qwen3.8-max.

pub fn qwen3_coder_plus(api_key key: String) -> Qwen

Qwen3 Coder Plus. Model ID: qwen3-coder-plus.

pub fn qwen3_max(api_key key: String) -> Qwen

Qwen3 Max. Model ID: qwen3-max.

pub fn qwq_plus(api_key key: String) -> Qwen

QwQ Plus. Model ID: qwq-plus.

pub fn seed(m: Qwen, s: Int) -> Qwen

Set the random seed for more repeatable output.

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

Stop generating when the model writes any of these strings.

pub fn temperature(m: Qwen, t: Float) -> Qwen

Set the sampling temperature.

pub fn top_k(m: Qwen, k: Int) -> Qwen

Set the top-k sampling value.

pub fn top_p(m: Qwen, p: Float) -> Qwen

Set the top-p (nucleus sampling) value.

✨ Search Document