Model Commands

Every command the model module offers, from its declarations, in order of the resource each acts on. Each command's help says the same.

Model

lnk model chat

Ask the model, with one typed request and response stream

lnk model chat [--json] [--request <request>]

It takes --json, boolean: Print the answer as JSON for other programs. It takes --request, string: JSON request file (default: standard input). It answers model.stream.

lnk model context

What the calling agent’s context is spent on, part by part

lnk model context [--chat <chat>] [--json]

It takes --chat, string: The chat to report, as the list of chats names it (default: the latest). It takes --json, boolean: Print the answer as JSON for other programs. It answers model.context.

lnk model count

Count text with the model tokenizer

lnk model count [--json] [--request <request>]

It takes --json, boolean: Print the answer as JSON for other programs. It takes --request, string: JSON request file (default: standard input). It answers model.counted.

lnk model delete

Delete a model from Ollama

lnk model delete <model> [--yes]

It takes model, position 1, string, required: The model, as lnk model list names it (qwen3 finds qwen3

). It takes --yes, boolean: Say yes to what it would ask. It answers core.report.

lnk model embed

Embed texts with the granted model

lnk model embed [--json] [--request <request>]

It takes --json, boolean: Print the answer as JSON for other programs. It takes --request, string: JSON request file (default: standard input). It answers model.embedded.

lnk model install

Install a model (and Ollama, if it's missing)

lnk model install [model] [--yes]

It takes model, position 1, string: A model (lnk model list); one not there comes from Ollama's library, e.g. qwen3

. It takes --yes, boolean: Say yes to what it would ask. It answers core.report.

lnk model list

List plain model names, from the granted provider or this machine

lnk model list [--fit] [--json] [--start]
  • --fit, boolean: Only the model that suits this machine, the one lnk model install picks, and why
  • --json, boolean: Print the answer as JSON for other programs
  • --start, boolean: Start Ollama first if it's installed but not running, so its models are listed too

It answers model.names.

lnk model serve

Serve a model's OpenAI-compatible API on a local port

lnk model serve [--json] [--model <model>] [--port <port>] [--upstream <upstream>]
  • --json, boolean: Print the answer as JSON for other programs
  • --model, string: A model of lnk model list: serve just this one. Requests use it whatever model they ask for, and /v1/models lists only it [default: every model of the runtime]
  • --port, integer, default 0: Port on 127.0.0.1 [default: any free one]
  • --upstream, string: Base URL of the model runtime, e.g. http://localhost:9000 [default: the one running on this machine, see lnk model list]

It answers model.serving.

lnk model show

What Link knows of a model: its window, longest answer, how it thinks, and its price

lnk model show [model] [--json]

It takes --json, boolean: Print the answer as JSON for other programs. It takes model, position 1, string: Model name required for owner inspection; omitted in an agent namespace to inspect its selected model. It answers model.shown.

lnk model transcribe

Transcribe audio with the granted provider

lnk model transcribe [--json] [--request <request>]

It takes --json, boolean: Print the answer as JSON for other programs. It takes --request, string: JSON request file (default: standard input). It answers model.heard.

lnk model usage

The calling agent’s measured model usage

lnk model usage [--json]

It takes --json, boolean: Print the answer as JSON for other programs. It answers model.usage.

Runtime

lnk model runtime add

Add a model runtime at an address of its own

lnk model runtime add <url> [--name <name>]

It takes --name, string, default Your server: What lnk model runtime list calls it. It takes url, position 1, string, required: Its address on this machine, e.g. http://localhost:5000. It answers core.report.

lnk model runtime list

List the model runtimes on this machine, and the models each runs

lnk model runtime list [--json] [--start]

It takes --json, boolean: Print the answer as JSON for other programs. It takes --start, boolean: Start Ollama first if it's installed but not running, so its models are listed too. It answers model.runtimes.

lnk model runtime remove

Remove a runtime lnk model runtime add added

lnk model runtime remove <name>

It takes name, position 1, string, required: The name lnk model runtime add gave it (lnk model runtime list). It answers core.report.