#[non_exhaustive]pub struct Profile {
pub name: String,
pub author: String,
pub slug: String,
pub description: String,
pub abilities: Vec<Ability>,
pub context_length: u32,
pub pricing: Option<Pricing>,
pub default_reasoning_effort: Option<ReasoningEffort>,
}Expand description
Represents a language model’s profile, including its name, description, abilities, context length, and optional pricing.
A model profile provides comprehensive information about a language model’s capabilities, limitations, and pricing structure. This allows applications to make informed decisions about which model to use for specific tasks.
§Examples
use aither::llm::model::{Profile, Ability, Pricing};
let profile = Profile::new("gpt-4", "GPT-4 Turbo", 128000)
.with_ability(Ability::ToolUse)
.with_ability(Ability::Vision);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe name of the model.
The author of the model.
slug: StringThe slug of the model.
description: StringA description of the model.
abilities: Vec<Ability>The abilities supported by the model.
context_length: u32The maximum context length supported by the model.
pricing: Option<Pricing>Optional pricing information for the model.
default_reasoning_effort: Option<ReasoningEffort>The reasoning effort the model runs at when a request sets none, as
its vendor documents it; None when no default is recorded.
Implementations§
Source§impl Profile
impl Profile
Sourcepub fn new(
name: impl Into<String>,
author: impl Into<String>,
slug: impl Into<String>,
description: impl Into<String>,
context_length: u32,
) -> Self
pub fn new( name: impl Into<String>, author: impl Into<String>, slug: impl Into<String>, description: impl Into<String>, context_length: u32, ) -> Self
Creates a new Profile with the given name, description, and context length.
§Arguments
name- The name of the model (e.g., “gpt-4”, “claude-3-opus”)description- A human-readable description of the modelcontext_length- Maximum number of tokens the model can process
§Examples
use aither::llm::model::Profile;
let profile = Profile::new("gpt-4", "GPT-4 Turbo", 128000);Sourcepub const fn with_default_reasoning_effort(
self,
effort: ReasoningEffort,
) -> Self
pub const fn with_default_reasoning_effort( self, effort: ReasoningEffort, ) -> Self
Records the reasoning effort the model runs at when a request sets none.
Sourcepub fn with_ability(self, ability: Ability) -> Self
pub fn with_ability(self, ability: Ability) -> Self
Sourcepub fn with_abilities(
self,
abilities: impl IntoIterator<Item = Ability>,
) -> Self
pub fn with_abilities( self, abilities: impl IntoIterator<Item = Ability>, ) -> Self
Adds multiple abilities to the profile.
§Arguments
abilities- An iterable collection of abilities to add
§Examples
use aither::llm::model::{Profile, Ability};
let abilities = [Ability::ToolUse, Ability::Vision, Ability::Audio];
let profile = Profile::new("multimodal", "A multimodal model", 32768)
.with_abilities(abilities);Sourcepub const fn with_pricing(self, pricing: Pricing) -> Self
pub const fn with_pricing(self, pricing: Pricing) -> Self
Sets the pricing information for the profile.
§Arguments
pricing- The pricing structure for this model
§Examples
use aither::llm::model::{Profile, Pricing};
let mut pricing = Pricing::default();
pricing.prompt = 0.01;
pricing.completion = 0.03;
let profile = Profile::new("paid-model", "A paid model", 4096)
.with_pricing(pricing);