pub enum Commands {
Show 19 variants
Model {
action: ModelCommands,
},
Daemon {
action: DaemonCommands,
},
Generate {Show 17 fields
prompt: Option<String>,
model: String,
model_path: Option<String>,
max_tokens: usize,
temperature: f32,
top_k: Option<usize>,
top_p: Option<f32>,
min_p: Option<f32>,
repetition_penalty: f32,
greedy: bool,
gpu: bool,
no_stream: bool,
quiet: bool,
gguf: bool,
draft: Option<String>,
draft_tokens: usize,
prompt_lookup: Option<usize>,
},
Summarize {
input: Option<String>,
model: String,
model_path: Option<String>,
min_length: Option<usize>,
max_length: Option<usize>,
num_beams: Option<usize>,
length_penalty: Option<f32>,
no_repeat_ngram: Option<usize>,
greedy: bool,
no_stream: bool,
gpu: bool,
quiet: bool,
},
Translate {Show 13 fields
input: Option<String>,
model: Option<String>,
model_path: Option<String>,
src: Option<String>,
dst: Option<String>,
max_length: Option<usize>,
num_beams: Option<usize>,
length_penalty: Option<f32>,
no_repeat_ngram: Option<usize>,
greedy: bool,
no_stream: bool,
gpu: bool,
quiet: bool,
},
Inspect {
path: String,
},
Embed {
input: Option<String>,
model: String,
model_path: Option<String>,
format: String,
no_normalize: bool,
normalize: bool,
pooling: String,
gpu: bool,
quiet: bool,
},
Mcp,
Serve {Show 17 fields
host: String,
port: u16,
chat: Option<String>,
embed: Option<String>,
classify: Option<String>,
zero_shot: Option<String>,
rerank: Option<String>,
transcribe: Option<String>,
translate: Option<String>,
summarize: Option<String>,
ner: Option<String>,
preload: bool,
api_key: Option<String>,
cors: bool,
prefix_cache: bool,
gpu: bool,
quiet: bool,
},
Transcribe {
file: String,
model: String,
model_path: Option<String>,
language: Option<String>,
translate: bool,
timestamps: bool,
max_tokens: Option<usize>,
no_stream: bool,
gpu: bool,
quiet: bool,
},
Classify {Show 14 fields
input: Vec<String>,
model: String,
model_path: Option<String>,
labels: Option<String>,
hypothesis: Option<String>,
top_k: usize,
threshold: Option<f32>,
max_length: Option<usize>,
batch_size: Option<usize>,
multi_label: bool,
format: String,
gpu: bool,
dtype: Option<String>,
quiet: bool,
},
Ner {
input: Vec<String>,
model: String,
model_path: Option<String>,
aggregation: String,
format: String,
gpu: bool,
quiet: bool,
},
Rerank {
query: String,
documents: Vec<String>,
model: String,
model_path: Option<String>,
top_k: Option<usize>,
format: String,
gpu: bool,
quiet: bool,
},
Agent {Show 15 fields
model: String,
model_path: Option<String>,
full_precision: bool,
gpu: bool,
dir: Option<String>,
yes: bool,
continue_last: bool,
resume: Option<String>,
sessions: bool,
no_memory: bool,
prompt: Option<String>,
temperature: f32,
max_tokens: usize,
max_steps: usize,
quiet: bool,
},
Chat {
model: String,
model_path: Option<String>,
system: Option<String>,
temperature: f32,
max_tokens: usize,
gpu: bool,
quiet: bool,
gguf: bool,
draft: Option<String>,
draft_tokens: usize,
think: bool,
},
Index {
action: IndexCommands,
},
Image {
action: ImageCommands,
},
Search {
index_path: String,
query: String,
top_k: usize,
mode: String,
model: Option<String>,
rerank_model: Option<String>,
format: String,
gpu: bool,
quiet: bool,
},
Similarity {
text1: String,
text2: String,
model: String,
gpu: bool,
quiet: bool,
},
}Variants§
Model
Manage models (list, download, info)
Fields
action: ModelCommandsDaemon
Run Kjarni as a background assistant: the agent, its memory and the OpenAI-compatible API behind one local web address
Fields
action: DaemonCommandsGenerate
Generate text from a prompt
Fields
gguf: boolPrefer quantized GGUF weights when the model has them
Q4_K_M is a fraction of the size and markedly faster to decode: measured on an RTX A2000, llama3.2-3b runs 24.5 tok/s from GGUF against 8.7 from full-precision safetensors. Falls back with a notice when the model has no GGUF published.
draft: Option<String>Draft model for speculative decoding. Must share the target’s vocabulary: a small model of the same family, such as qwen2.5-0.5b-instruct drafting for qwen2.5-1.5b.
Summarize
Summarize text
Fields
Translate
Translate text between languages
Fields
model: Option<String>Model to use. By default opus-mt-en-de or opus-mt-de-en for those two directions, and flan-t5-base, which is much less reliable, for the rest
Inspect
Show a model’s metadata, config and tensor layout
Embed
Generate embeddings for text
Fields
pooling: StringPooling strategy: mean, cls, max
Mean matches what sentence-transformers does for these models, and what the library bindings and presets already default to. Pooling changes the vector itself, so a different choice here does not produce a slightly different answer, it produces one that cannot be compared against the others.
Mcp
Serve Kjarni’s tools to AI agents over MCP (stdio): folder search, photo search, transcription, classification, reranking and similarity
Serve
Serve Kjarni over HTTP with an OpenAI-compatible API: chat, completions, embeddings and speech-to-text, plus reranking, classification, translation, summarization and entity recognition.
Any OpenAI client works by pointing its base URL at http://127.0.0.1:8080/v1. A request picks a model by its Kjarni name, such as “qwen2.5-1.5b-instruct”, or gets the default set by the flags below. Each model loads on its first request and stays loaded.
Fields
host: StringAddress to listen on. Use 0.0.0.0 to accept other machines, and set an API key when you do
translate: Option<String>Default model for /v1/translate. Without one, a model is picked for each language pair
preload: boolLoad the models named by the flags above before taking requests, instead of on their first request
api_key: Option<String>Require ‘Authorization: Bearer KEY’ on every /v1 request. Also read from the KJARNI_API_KEY environment variable
Transcribe
Transcribe audio to text
Fields
Classify
Classify text using a classification model
Fields
labels: Option<String>Comma-separated labels. With a zero-shot model such as minilm-zeroshot, the labels to choose from: –labels “sizing,shipping,price”. With other models, names for the model’s own labels, in the order of its output: –labels “neikvætt,jákvætt”
hypothesis: Option<String>Zero-shot models only: the hypothesis each label is put into, with {} where the label goes [default: “This example is {}.”]
Ner
Find names of people, places, organizations and other entities
Several texts go one per line on stdin. –model-path takes any *ForTokenClassification model from the Hugging Face Hub, such as an Icelandic or a medical one.
Fields
Rerank
Rerank documents by relevance to a query
Fields
Agent
An assistant that uses tools: it reads and edits files, runs commands and fetches web pages (asking first), and remembers between sessions
Fields
Chat
Interactive chat mode
Fields
gguf: boolPrefer quantized GGUF weights when the model has them
Q4_K_M is a fraction of the size and markedly faster to decode: measured on an RTX A2000, llama3.2-3b runs 24.5 tok/s from GGUF against 8.7 from full-precision safetensors. Falls back with a notice when the model has no GGUF published.
Index
Create or manage search indexes
Fields
action: IndexCommandsImage
Index and search images by description
Fields
action: ImageCommandsSearch
Search an index
Fields
model: Option<String>Encoder model for semantic search. Defaults to the model the index was built with.
Similarity
Compute similarity between two texts
Trait Implementations§
Source§impl FromArgMatches for Commands
impl FromArgMatches for Commands
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.impl StructuralPartialEq for Commands
Source§impl Subcommand for Commands
impl Subcommand for Commands
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Forget for Commands
impl Freeze for Commands
impl Move for Commands
impl RefUnwindSafe for Commands
impl Send for Commands
impl Sync for Commands
impl Unpin for Commands
impl UnsafeUnpin for Commands
impl UnwindSafe for Commands
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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