Skip to main content
The CLI mode provides non-interactive table output and JSON-formatted results for scripting and automation. Use subcommands for specific tasks or the --cli flag to get a fit table instead of the TUI.

CLI vs TUI

Any subcommand automatically uses CLI mode. The --cli flag forces CLI mode when no subcommand is given.

Global Flags

These flags work with all subcommands:
boolean
Output results as JSON instead of formatted tables. Useful for parsing with jq, scripts, or agents.
string
Override GPU VRAM size. Accepts suffixes: G/GB/GiB, M/MB/MiB, T/TB/TiB (case-insensitive).Examples: --memory 32G, --memory 24000M, --memory 1.5TUseful when GPU autodetection fails (VMs, passthrough, broken nvidia-smi).
integer
Cap context length used for memory estimation (in tokens). Does not change the model’s advertised max context.Example: --max-context 8192Falls back to OLLAMA_CONTEXT_LENGTH environment variable if not set.

Subcommands

system

Show detected hardware specifications.
Output:
JSON output:
string
Override detected GPU VRAM:

list

List all models in the database (no fit analysis).
Output: Table with columns: Name, Provider, Params, Quant, Context, Use Case, Released

fit

Find models that fit your system with ranked table output.
Flags:
boolean
Show only models that perfectly match recommended specs (GPU required, meets recommended VRAM/RAM).
integer
Limit number of results returned.
enum
Sort column for fit output.Values: score (default), tps, params, mem, ctx, date, useAliases:
  • tps: tokens, toks, throughput
  • mem: memory, mem_pct, utilization
  • ctx: context
  • date: release, released
  • use: use_case, usecase
Output columns:
  • Fit: Indicator () colored by fit level
  • Model: Model name
  • Provider: Model provider
  • Params: Parameter count
  • Score: Composite score (0-100)
  • tok/s: Estimated tokens/second
  • Quant: Best quantization for your hardware
  • Mode: Run mode (GPU, MoE, CPU+GPU, CPU)
  • Mem %: Memory utilization percentage
  • Ctx: Context window (in thousands of tokens)
  • Fit Level: Perfect, Good, Marginal, Too Tight
JSON output:
Returns array of model fit objects with full metadata, scoring breakdown, memory requirements, and runtime info.
Search for models by name, provider, or size (fuzzy match).
Output: Table of matching models with basic metadata (no fit analysis).

info

Show detailed information about a specific model.
If multiple models match, you’ll be prompted to be more specific. Output:
  • Full model metadata
  • Score breakdown (Quality, Speed, Fit, Context)
  • Estimated tokens/second
  • Memory requirements (min/recommended VRAM/RAM)
  • Fit level and run mode for your system
  • MoE architecture details (if applicable)
  • GGUF download sources
JSON output:
Returns single-element array with full model fit object.

plan

Estimate required hardware for a specific model configuration. Inverts normal fit analysis: instead of “what fits my hardware?”, asks “what hardware is needed for this model config?”
Flags:
string
required
Model selector (name or unique partial name). Resolves to a single model from the database.
integer
required
Context length for estimation in tokens (e.g., 4096, 8192, 32768).
string
Quantization override (e.g., Q4_K_M, Q8_0, mlx-4bit). Omit for auto-selection based on context.
number
Target decode speed in tokens/second. Used to recommend GPU memory bandwidth.
Output: Human-readable:
  • Model name and configuration
  • Minimum hardware (VRAM, RAM, CPU cores)
  • Recommended hardware
  • Feasibility of GPU, CPU+GPU offload, CPU-only paths with estimated TPS and fit level
  • Upgrade deltas to reach better fit targets
JSON:

recommend

Get top model recommendations for your hardware (JSON-friendly).
Flags:
integer
default:"5"
Maximum number of recommendations to return.
enum
Filter by use case category.Values: general, coding, reasoning, chat, multimodal, embedding
enum
default:"marginal"
Minimum fit level to include.Values: perfect, good, marginal
enum
default:"any"
Filter by inference runtime.Values: any, mlx, llamacpp
boolean
default:"true"
Output as JSON (default for recommend command).
Output: JSON array of model fit objects ranked by composite score, filtered by specified criteria. Perfect for agent/script consumption.

download

Download a GGUF model from HuggingFace for use with llama.cpp.
Flags:
string
required
Model to download. Can be:
  • HuggingFace repo (e.g., bartowski/Llama-3.1-8B-Instruct-GGUF)
  • Search query (e.g., llama 8b)
  • Known model name (e.g., llama-3.1-8b-instruct)
string
Specific GGUF quantization to download (e.g., Q4_K_M, Q8_0). If omitted, selects the best quantization that fits your hardware.
number
Maximum memory budget in GB for auto-selection. Defaults to detected GPU VRAM or available RAM.
boolean
List available GGUF files in the repo without downloading.
Output: Progress bar with download status, final file path, and run instructions.
Search HuggingFace for GGUF models compatible with llama.cpp.
Flags:
string
required
Search query (model name, architecture, etc.)
integer
default:"10"
Maximum number of results to return.
Output: Table of HuggingFace repositories with GGUF files, including repo ID and model type.

run

Run a downloaded GGUF model with llama-cli or llama-server.
Flags:
string
required
Model file or name. If a name is given, searches the local llama.cpp cache directory.
boolean
Run as an OpenAI-compatible API server instead of interactive chat.
integer
default:"8080"
Port for the API server (only with --server).
integer
default:"-1"
Number of GPU layers to offload. -1 means all layers (full GPU).
integer
default:"4096"
Context size in tokens.
Output: Launches llama-cli (interactive) or llama-server (API mode) with the specified model and configuration.

serve

Start llmfit REST API server for cluster/node scheduling workflows. See REST API Guide for full endpoint documentation.
Flags:
string
default:"0.0.0.0"
Host interface to bind.
integer
default:"8787"
Port to listen on.
Output: HTTP server running on specified host/port. Access endpoints:
  • GET /health - Liveness probe
  • GET /api/v1/system - Node hardware info
  • GET /api/v1/models - Full fit list with filters
  • GET /api/v1/models/top - Top runnable models for scheduling
See REST API Guide for query parameters and response schemas.

Examples

Find top 5 perfectly fitting models

Get JSON recommendations for coding

Search and get info

Override GPU memory and cap context

Plan hardware for a workload

Download and run a model

JSON Schema Reference

All --json output follows consistent schemas: System (llmfit --json system):
Model Fit (llmfit --json fit, recommend, info):
Plan (llmfit --json plan):
Pipe JSON output to jq for filtering and formatting:
The --json flag is global and works with system, fit, info, plan, and recommend subcommands.