Skip to main content

Commands

Enum Commands 

Source
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

§

Daemon

Run Kjarni as a background assistant: the agent, its memory and the OpenAI-compatible API behind one local web address

Fields

§

Generate

Generate text from a prompt

Fields

§prompt: Option<String>

The prompt (or file path, or stdin if not provided)

§model: String
§model_path: Option<String>

Load weights from a local file or directory instead of the registry

§max_tokens: usize

Maximum tokens to generate

§temperature: f32

Sampling temperature (0.0 = greedy, higher = more random)

§top_k: Option<usize>

Top-K sampling (limits to K most likely tokens)

§top_p: Option<f32>

Top-P (nucleus) sampling threshold

§min_p: Option<f32>

Min-P sampling threshold

§repetition_penalty: f32

Repetition penalty (1.0 = no penalty)

§greedy: bool

Use greedy decoding (ignores temperature)

§gpu: bool

Use GPU

§no_stream: bool

Disable streaming output

§quiet: bool

Suppress status messages

§gguf: bool

Prefer 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.

§draft_tokens: usize

Tokens the draft proposes per round. Higher trades wasted draft work against fewer passes over the target’s weights.

§prompt_lookup: Option<usize>

Speculate from earlier in the text instead of with a draft model, matching up to this many tokens. Helps where the output repeats the input.

§

Summarize

Summarize text

Fields

§input: Option<String>

Input text (or read from stdin)

§model: String

Model to use

§model_path: Option<String>

Load a BART or T5 model from a Hugging Face folder instead of the registry

§min_length: Option<usize>

Minimum summary length

§max_length: Option<usize>

Maximum summary length

§num_beams: Option<usize>

Number of beams for beam search

§length_penalty: Option<f32>

Length penalty for beam search (< 1 shorter, > 1 longer)

§no_repeat_ngram: Option<usize>

Block repeated n-grams of this size

§greedy: bool

Use greedy decoding (deterministic, fastest)

§no_stream: bool

Disable streaming output

§gpu: bool

Use GPU

§quiet: bool

Suppress progress messages

§

Translate

Translate text between languages

Fields

§input: Option<String>

Input text (or read from stdin)

§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

§model_path: Option<String>

Load a Marian (opus-mt) or T5 model from a Hugging Face folder instead of the registry

§src: Option<String>

Source language (e.g., en, de, fr)

§dst: Option<String>

Target language (e.g., en, de, fr)

§max_length: Option<usize>

Maximum output length

§num_beams: Option<usize>

Number of beams for beam search

§length_penalty: Option<f32>

Length penalty for beam search (< 1 shorter, > 1 longer)

§no_repeat_ngram: Option<usize>

Block repeated n-grams of this size

§greedy: bool

Use greedy decoding (deterministic, fastest)

§no_stream: bool

Disable streaming output

§gpu: bool

Use GPU

§quiet: bool

Suppress progress messages

§

Inspect

Show a model’s metadata, config and tensor layout

Fields

§path: String

Path to a .gguf, a .safetensors directory, or a name in ~/.cache/kjarni

§

Embed

Generate embeddings for text

Fields

§input: Option<String>

Input text, file path, or stdin if not provided

§model: String

Embedding model

§model_path: Option<String>

Load weights from a local file or directory instead of the registry

§format: String

Output format: raw, json

§no_normalize: bool

Keep the raw pooled vector instead of scaling it to unit length

§normalize: bool

Scale each vector to unit length, which is the default

§pooling: String

Pooling 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.

§gpu: bool

Run on the GPU

§quiet: bool

Suppress status messages

§

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: String

Address to listen on. Use 0.0.0.0 to accept other machines, and set an API key when you do

§port: u16

Port to listen on

§chat: Option<String>

Default model for /v1/chat/completions and /v1/completions

§embed: Option<String>

Default model for /v1/embeddings

§classify: Option<String>

Default model for /v1/classify without labels

§zero_shot: Option<String>

Default model for /v1/classify with labels (zero-shot)

§rerank: Option<String>

Default model for /v1/rerank

§transcribe: Option<String>

Default model for /v1/audio/transcriptions and /v1/audio/translations

§translate: Option<String>

Default model for /v1/translate. Without one, a model is picked for each language pair

§summarize: Option<String>

Default model for /v1/summarize

§ner: Option<String>

Default model for /v1/ner

§preload: bool

Load 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

§cors: bool

Allow requests from web pages on other origins (CORS)

§prefix_cache: bool

Reuse the work on a conversation’s earlier turns between chat requests. Faster multi-turn chat, more memory

§gpu: bool

Run models on the GPU

§quiet: bool

Don’t log requests or startup messages

§

Transcribe

Transcribe audio to text

Fields

§file: String

Path to audio file (wav, mp3, flac, ogg)

§model: String

Model to use (whisper-small, whisper-large-v3)

§model_path: Option<String>

Load a Whisper model from a Hugging Face folder instead of the registry

§language: Option<String>

Language code (e.g., en, fr, de). Omit for auto-detect.

§translate: bool

Translate to English instead of transcribing

§timestamps: bool

Print each segment with its start and end time. Waits for the whole transcript rather than streaming it.

§max_tokens: Option<usize>

Maximum tokens per 30-second chunk

§no_stream: bool

Disable streaming (wait for full result)

§gpu: bool

Use GPU acceleration

§quiet: bool

Suppress progress output

§

Classify

Classify text using a classification model

Fields

§input: Vec<String>

Input text(s) to classify. Use - for stdin.

§model: String

Model name from registry

§model_path: Option<String>

Load model from local path instead of registry

§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 {}.”]

§top_k: usize

Return top K predictions

§threshold: Option<f32>

Minimum confidence threshold (0.0-1.0)

§max_length: Option<usize>

Maximum sequence length (truncates longer inputs)

§batch_size: Option<usize>

Batch size for inference

§multi_label: bool

Use multi-label classification (sigmoid instead of softmax). With a zero-shot model, judge each label on its own.

§format: String

Output format: json, jsonl, text

§gpu: bool

Run on GPU

§dtype: Option<String>

Model precision: f32, f16, bf16

§quiet: bool

Suppress progress output

§

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

§input: Vec<String>

Text to read. Words without quotes are one text. Reads stdin if empty.

§model: String

Model name from registry

§model_path: Option<String>

Load model from local path instead of registry

§aggregation: String

How tokens become entities, as in transformers: first (keeps words whole), simple, max or average

§format: String

Output format: text, json, jsonl

§gpu: bool

Run on GPU

§quiet: bool

Suppress progress output

§

Rerank

Rerank documents by relevance to a query

Fields

§query: String

The query to rank against

§documents: Vec<String>

Documents to rerank (or read from stdin, one per line)

§model: String
§model_path: Option<String>

Load a cross-encoder from a Hugging Face folder instead of the registry

§top_k: Option<usize>

Return only top K results

§format: String

Output format: json, jsonl, text, docs

§gpu: bool

Run on the GPU

§quiet: bool

Suppress progress output

§

Agent

An assistant that uses tools: it reads and edits files, runs commands and fetches web pages (asking first), and remembers between sessions

Fields

§model: String
§model_path: Option<String>

Load weights from a local file or directory instead of the registry

§full_precision: bool

Load full-precision safetensors instead of the Q4_K_M GGUF

§gpu: bool

Run the model on the GPU

§dir: Option<String>

Folder the tools work in. Default: the current folder

§yes: bool

Run every tool call without asking first

§continue_last: bool

Continue the most recent conversation

§resume: Option<String>

Continue a saved conversation, by the id –sessions lists

§sessions: bool

List saved conversations and exit

§no_memory: bool

Neither read nor save long-term memory

§prompt: Option<String>

Answer this one message, then exit

§temperature: f32

Sampling temperature

§max_tokens: usize

Max tokens per model reply; a file the agent writes must fit in one

§max_steps: usize

Model replies per message at most

§quiet: bool

Suppress the banner and progress output

§

Chat

Interactive chat mode

Fields

§model: String
§model_path: Option<String>

Load weights from a local file or directory instead of the registry

§system: Option<String>

System prompt to set assistant behavior

§temperature: f32

Sampling temperature

§max_tokens: usize

Max tokens per response

§gpu: bool

Run on the GPU

§quiet: bool

Suppress progress output

§gguf: bool

Prefer 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, such as qwen2.5-0.5b-instruct drafting for qwen2.5-1.5b.

§draft_tokens: usize

Tokens the draft proposes per round.

§think: bool

Let the model reason before it answers, for models that can, such as Qwen 3.5. The reasoning is shown dimmed. It runs to hundreds of tokens, so raise –max-tokens with it.

§

Index

Create or manage search indexes

Fields

§

Image

Index and search images by description

Fields

§

Search

Search an index

Fields

§index_path: String

Path to the index file

§query: String

Search query

§top_k: usize

Number of results to return

§mode: String

Search mode: hybrid, semantic, keyword

§model: Option<String>

Encoder model for semantic search. Defaults to the model the index was built with.

§rerank_model: Option<String>

Reranking model (optional) Use a cross-encoder model to rerank initial results Example: –rerank-model “ms-marco-minilm”

§format: String

Output format: json, jsonl, text

§gpu: bool

Run on the GPU

§quiet: bool

Suppress progress output

§

Similarity

Compute similarity between two texts

Fields

§text1: String

First text (or file path)

§text2: String

Second text (or file path)

§model: String

Encoder model

§gpu: bool

Run on the GPU

§quiet: bool

Suppress progress output

Trait Implementations§

Source§

impl Debug for Commands

Source§

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

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

impl FromArgMatches for Commands

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl PartialEq for Commands

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Commands

Source§

impl Subcommand for Commands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

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