Skip to main content

ProviderEntry

Struct ProviderEntry 

Source
pub struct ProviderEntry {
Show 28 fields pub provider_type: ProviderKind, pub name: Option<String>, pub model: Option<String>, pub base_url: Option<String>, pub max_tokens: Option<u32>, pub embedding_model: Option<String>, pub stt_model: Option<String>, pub embed: bool, pub default: bool, pub thinking: Option<ThinkingConfig>, pub server_compaction: bool, pub enable_extended_context: bool, pub prompt_cache_ttl: Option<CacheTtl>, pub reasoning_effort: Option<String>, pub thinking_level: Option<GeminiThinkingLevel>, pub thinking_budget: Option<i32>, pub include_thoughts: Option<bool>, pub api_key: Option<String>, pub candle: Option<CandleInlineConfig>, pub vision_model: Option<String>, pub gonka_nodes: Vec<GonkaNode>, pub gonka_chain_prefix: Option<String>, pub cocoon_client_url: Option<String>, pub cocoon_access_hash: Option<String>, pub cocoon_health_check: bool, pub cocoon_pricing: Option<CocoonPricing>, pub instruction_file: Option<PathBuf>, pub max_concurrent: Option<u32>,
}
Expand description

Unified provider entry: one struct replaces CloudLlmConfig, OpenAiConfig, GeminiConfig, OllamaConfig, CompatibleConfig, and OrchestratorProviderConfig.

Provider-specific fields use #[serde(default)] and are ignored by backends that do not use them (flat-union pattern).

Fields§

§provider_type: ProviderKind

Required: provider backend type.

§name: Option<String>

Optional name for multi-provider configs. Auto-generated from type if absent.

§model: Option<String>

Model identifier. Required for most types.

§base_url: Option<String>

API base URL. Each type has its own default.

§max_tokens: Option<u32>

Max output tokens.

§embedding_model: Option<String>

Embedding model. When set, this provider supports embed() calls.

§stt_model: Option<String>

STT model. When set, this provider supports speech-to-text via the Whisper API or Candle-local inference.

§embed: bool

Mark this entry as the embedding provider (handles embed() calls).

§default: bool

Mark this entry as the default chat provider (overrides position-based default).

§thinking: Option<ThinkingConfig>§server_compaction: bool§enable_extended_context: bool§prompt_cache_ttl: Option<CacheTtl>

Prompt cache TTL variant. None keeps the default ~5-minute ephemeral TTL. Set to "1h" to enable the extended 1-hour TTL (beta, ~2× write cost).

§reasoning_effort: Option<String>§thinking_level: Option<GeminiThinkingLevel>§thinking_budget: Option<i32>§include_thoughts: Option<bool>§api_key: Option<String>§candle: Option<CandleInlineConfig>§vision_model: Option<String>§gonka_nodes: Vec<GonkaNode>

Gonka network node pool. Required (non-empty) when type = "gonka".

§gonka_chain_prefix: Option<String>

bech32 chain prefix for address encoding. Defaults to "gonka" when omitted.

§cocoon_client_url: Option<String>

Cocoon sidecar HTTP URL. Defaults to "http://localhost:10000" when absent.

§cocoon_access_hash: Option<String>

Sentinel field for access hash. Leave empty in config; actual value is resolved from the age vault as ZEPH_COCOON_ACCESS_HASH.

§cocoon_health_check: bool

Whether to perform a health check against /stats at provider construction time.

§cocoon_pricing: Option<CocoonPricing>

Manual per-1K-token pricing for this Cocoon provider.

Cocoon model names (e.g. Qwen/Qwen3-0.6B) are not in the built-in pricing table. When this section is present, the values are registered with CostTracker at startup so that token costs are tracked accurately.

Example TOML:

[llm.providers.cocoon_pricing]
prompt_cents_per_1k = 0.01
completion_cents_per_1k = 0.03
§instruction_file: Option<PathBuf>

Provider-specific instruction file.

§max_concurrent: Option<u32>

Maximum concurrent LLM calls from orchestrated sub-agents to this provider.

When set, DagScheduler acquires a semaphore permit before dispatching a sub-agent that targets this provider. Dispatch is deferred (using the existing deferral_backoff mechanism) when the semaphore is saturated.

None (default) = unlimited — no admission control applied.

§Example (TOML)

[[llm.providers]]
name = "quality"
type = "openai"
model = "gpt-5"
max_concurrent = 3

Implementations§

Source§

impl ProviderEntry

Source

pub fn effective_name(&self) -> String

Resolve the effective name: explicit name field or type string.

Source

pub fn effective_model(&self) -> String

Resolve the effective model: explicit model field or the provider-type default.

Defaults mirror those used in build_provider_from_entry so that runtime.model_name always reflects the actual model being used rather than the provider type string.

Source

pub fn validate(&self) -> Result<(), ConfigError>

Validate this entry for cross-field consistency.

§Errors

Returns ConfigError when a fatal invariant is violated (e.g. compatible provider without a name).

Source

pub fn effective_gonka_chain_prefix(&self) -> &str

Resolve the effective Gonka chain prefix: explicit value or "gonka" default.

Trait Implementations§

Source§

impl Clone for ProviderEntry

Source§

fn clone(&self) -> ProviderEntry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProviderEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for ProviderEntry

Source§

fn default() -> ProviderEntry

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ProviderEntry

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ProviderEntry, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ProviderEntry

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,