Module model

Source
Expand description

Model identifiers used throughout the artificial workspace.

The enum hierarchy keeps the public API blissfully simple while allowing each provider crate to map the variants onto its own naming scheme. As a consequence you never have to type literal strings such as "gpt-4o-mini" in your application code—pick an enum variant instead and let the adapter translate it.

§Adding more models

  1. Provider–specific enum Add the variant to the sub-enum (OpenAiModel, AnthropicModel, …).
  2. Mapping layer Update the mapping function in the provider crate (artificial-openai::model_map::map_model, etc.).
  3. Compile-time safety The compiler will tell you if you forgot to handle the new variant in From<T> for Model or in provider match statements.

§Example

use artificial_core::model::{Model, OpenAiModel};
assert_eq!(Model::from(OpenAiModel::Gpt4oMini),
           Model::OpenAi(OpenAiModel::Gpt4oMini));

Enums§

Model
Universal identifier for an LLM model.
OpenAiModel
Exhaustive list of models officially supported by the OpenAI back-end.