# Complete Guide to llmfit CLI Subcommands: 10 Essential Commands for LLM Deployment

> Explore 10 essential llmfit CLI subcommands like fit, serve, and bench for efficient LLM deployment. Discover hardware detection, model catalog queries, and performance benchmarking.

- Repository: [Alex Jones/llmfit](https://github.com/AlexsJones/llmfit)
- Tags: how-to-guide
- Published: 2026-08-19

---

**The llmfit binary exposes ten distinct llmfit CLI subcommands—`fit`, `system`, `doctor`, `list`, `search`, `info`, `recommend`, `plan`, `serve`, and `bench`—defined in [`llmfit-tui/src/main.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-tui/src/main.rs) using the clap crate, enabling hardware detection, model catalog queries, and performance benchmarking with JSON or table output.**

The llmfit tool serves as the primary interface to the *llmfit-core* analysis engine, routing user input through a structured command hierarchy. According to the source code in [[`llmfit-tui/src/main.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-tui/src/main.rs)](https://github.com/AlexsJones/llmfit/blob/main/llmfit-tui/src/main.rs), the CLI implements a `Commands` enum that dispatches to specialized handlers in the core library, supporting both interactive TUI and programmatic JSON workflows.

## Core Analysis Commands

These subcommands leverage the analysis engine in [[`llmfit-core/src/analysis.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/analysis.rs)](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/analysis.rs) to evaluate model compatibility against detected or overridden hardware specifications.

### fit

The `fit` subcommand runs the full model-fit analysis, returning a ranked list of models that match your current hardware profile. It accepts the `--perfect` flag to show only models guaranteed to run without swapping, and the `-n` parameter to limit results.

```bash

# Show the top 5 perfect-fit models

llmfit fit --perfect -n 5

```

### recommend

The `recommend` subcommand produces a ranked list of models optimized for your specific use case, such as coding or inference. It supports hardware overrides and JSON output for integration with automation pipelines.

```bash

# Recommend best coding models, output as JSON

llmfit recommend --json --use-case coding --limit 4

```

### plan

The `plan` subcommand estimates hardware upgrade requirements for target model configurations, calculating VRAM needs based on context length and quantization settings.

```bash

# Plan GPU memory requirements for a 4-bit quantized model

llmfit plan "Qwen/Qwen3-4B-MLX-4bit" --context 8192 --quant mlx-4bit --json

```

## Hardware Inspection Commands

These commands interface with [[`llmfit-core/src/hardware.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/hardware.rs)](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/hardware.rs) to detect and report system specifications.

### system

The `system` subcommand prints a formatted table of detected hardware, including CPU cores, RAM capacity, and GPU specifications.

```bash
llmfit system

```

### doctor

The `doctor` subcommand emits a detailed diagnostics report combining raw output from `nvidia-smi` or `rocm-smi` with llmfit's hardware interpretation, essential for debugging deployment issues.

```bash
llmfit doctor

```

## Model Catalog Commands

These subcommands query the embedded model database without performing hardware analysis.

### list

The `list` subcommand enumerates every model entry in the embedded database, generating a complete catalog of supported architectures and providers.

```bash
llmfit list

```

### search

The `search` subcommand performs text-based filtering across model names, providers, and parameter sizes.

```bash
llmfit search "llama 8b"

```

### info

The `info` subcommand displays detailed specifications for a single model, including parameter counts, VRAM requirements, and quantization compatibility.

```bash
llmfit info "Mistral-7B"

```

## Deployment and Testing Commands

### serve

The `serve` subcommand launches a lightweight REST API defined in [[`llmfit-tui/src/serve_api.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-tui/src/serve_api.rs)](https://github.com/AlexsJones/llmfit/blob/main/llmfit-tui/src/serve_api.rs), mirroring CLI functionality for remote agents or cluster scheduling.

```bash
llmfit serve --host 0.0.0.0 --port 8787

```

### bench

The `bench` subcommand runs throughput benchmarks against specific providers (Ollama, vLLM, MLX, llama-cpp), implemented in [[`llmfit-core/src/bench.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/bench.rs)](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/bench.rs). The optional `--share` flag uploads results to the community repository.

```bash
llmfit bench --provider ollama --share --dry-run

```

## Global Flags and Output Modifiers

All **llmfit CLI subcommands** accept global flags defined in the CLI entry point to modify behavior:

- `--json`: Force JSON output for programmatic consumption
- `--memory`, `--ram`, `--cpu-cores`, `--max-context`: Override auto-detected hardware values
- `--cli`: Force command-line mode even when TUI is available

Example combining global flags with subcommands:

```bash

# Show hardware specs in JSON format

llmfit --json system

# Benchmark with hardware overrides

llmfit bench --all --share --memory 64GB

```

## Summary

- The **llmfit CLI subcommands** are defined in [`llmfit-tui/src/main.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-tui/src/main.rs) using the clap crate, providing type-safe argument parsing for ten distinct operations.
- **Analysis commands** (`fit`, `recommend`, `plan`) interface with [`llmfit-core/src/analysis.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/analysis.rs) to evaluate model-hardware compatibility.
- **Inspection commands** (`system`, `doctor`) leverage [`llmfit-core/src/hardware.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/hardware.rs) for system diagnostics.
- **Catalog commands** (`list`, `search`, `info`) query the embedded model database without hardware validation.
- **Service commands** (`serve`, `bench`) enable API deployment and performance testing via [`llmfit-tui/src/serve_api.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-tui/src/serve_api.rs) and [`llmfit-core/src/bench.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/bench.rs).
- Global flags including `--json` and hardware overrides apply universally across all subcommands.

## Frequently Asked Questions

### What is the difference between the fit and recommend subcommands?

The `fit` subcommand evaluates all models against your current hardware and returns compatibility rankings, while `recommend` filters results by specific use cases such as coding or chat, applying additional heuristics beyond raw hardware fit. Both commands use the same core scoring algorithm in [`llmfit-core/src/analysis.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/analysis.rs), but `recommend` applies user-intent weighting to the results.

### How do I enable JSON output for all llmfit CLI subcommands?

All subcommands respect the global `--json` flag, which can be placed before the subcommand (e.g., `llmfit --json system`). This flag forces machine-readable output suitable for integration with shell scripts or orchestration tools, bypassing the default TUI or plain table formatting.

### Which source file implements the hardware detection for the system and doctor commands?

Hardware detection is implemented in [[`llmfit-core/src/hardware.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/hardware.rs)](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/hardware.rs), which exports system specifications to both the `system` and `doctor` subcommands. The `doctor` command additionally appends raw output from vendor-specific tools like `nvidia-smi` to aid in debugging GPU driver issues.

### Can I run llmfit benchmarks against multiple providers simultaneously?

Yes, the `bench` subcommand supports the `--all` flag to cycle through configured providers (Ollama, vLLM, MLX, llama-cpp) sequentially, as implemented in [`llmfit-core/src/bench.rs`](https://github.com/AlexsJones/llmfit/blob/main/llmfit-core/src/bench.rs). When combined with the `--share` flag, results are aggregated and pushed to the community repository for comparative analysis.