Rust API reference · Kjarni 0.2.8

kjarni::registry

Model registry and management

ModelEntry

pub struct ModelEntry

Information about a model for display purposes

Fields

  • pub model_type: ModelType,
  • pub cli_name: String,
  • pub architecture: ModelArchitecture,
  • pub description: String,
  • pub size: String,
  • pub params: String,
  • pub downloaded: bool,
  • pub has_gguf: bool,

all_model_names

pub fn all_model_names() -> Vec<String>

Get all available model names

cache_dir

pub fn cache_dir() -> PathBuf

Get the cache directory for all models

download_model

pub async fn download_model(name: &str, prefer_gguf: bool, quiet: bool) -> Result<()>

Download a model by CLI name

get_model_info

pub fn get_model_info(name: &str) -> Result<ModelEntry>

Get detailed info about a specific model

is_model_downloaded

pub fn is_model_downloaded(name: &str) -> Result<bool>

Check if a model is downloaded

list_models

pub fn list_models() -> Vec<ModelEntry>

List all available models with their download status

list_models_by_architecture

pub fn list_models_by_architecture(arch: ModelArchitecture) -> Vec<ModelEntry>

List models filtered by architecture

list_models_by_group

pub fn list_models_by_group(group: &str) -> Vec<ModelEntry>

Get models by task group

model_path

pub fn model_path(name: &str) -> Result<PathBuf>

Get the path where a specific model would be stored

validate_model_name

pub fn validate_model_name(name: &str) -> bool

Validate a model name without loading it

Kjarni runs the same engine on every platform: