CLI Reference¶
Fuse provides a command-line interface for extraction, training, and quantization.
fuse extract¶
Run structured extraction on text input.
With a config file¶
With inline flags¶
# HuggingFace model — auto-downloads
fuse extract "SpaceX was founded in 2002" \
--model bartowski/Phi-4-mini-instruct-GGUF \
--fields "company:str,year:int,industry:str"
# Local GGUF model
fuse extract "John is 30" \
--model ./model.gguf \
--fields "name:str,age:int"
# Using a JSON schema file
fuse extract "John is 30 and knows Python" \
--model bartowski/Llama-3.2-1B-Instruct-GGUF \
--schema schema.json
With uvx (no install)¶
uvx fusellm extract "Sarah Chen is a 34-year-old architect" \
--model bartowski/Llama-3.2-1B-Instruct-GGUF \
--fields "name:str,age:int,job_title:str"
With evidence spans¶
Add --spans to see where each extracted value was found in the source text:
fuse extract "Sarah Chen is a 34-year-old architect at Stripe" \
--model bartowski/Llama-3.2-1B-Instruct-GGUF \
--fields "name:str,age:int,job_title:str,company:str" \
--spans
Output includes evidence quotes, explicit/implicit classification, and character offsets.
HTML visualization¶
Generate an interactive HTML file with color-coded highlighted spans:
fuse extract "Sarah Chen is a 34-year-old architect at Stripe" \
--model bartowski/Llama-3.2-1B-Instruct-GGUF \
--fields "name:str,age:int,job_title:str,company:str" \
--html result.html
The HTML output shows:
- Each field highlighted with a distinct color in the source text
- Solid outlines for explicit extractions (value is verbatim in text)
- Dashed outlines for implicit extractions (value is inferred from context)
- Hover tooltips with field name and value
- A legend with field details, types, and character offsets
Tip
--html implies --spans — you don't need to pass both.
Options¶
| Option | Description |
|---|---|
--config PATH |
YAML config file for extraction |
--model TEXT |
Model path (local GGUF) or HuggingFace repo name |
--fields TEXT |
Comma-separated field definitions (e.g., name:str,age:int) |
--schema PATH |
JSON schema file path |
--format TEXT |
Prompt format: llama, chatml, or generic (default: llama) |
--max-tokens INT |
Maximum tokens to generate (default: 512) |
--spans |
Include evidence spans with source text localization |
--html PATH |
Write highlighted HTML visualization to file |
fuse train¶
Fine-tune a model using LoRA.
Options¶
| Option | Description |
|---|---|
--config PATH |
Required. YAML training config file |
See Training Configuration for config file format.
fuse quantize¶
Convert a trained model to GGUF format.
Options¶
| Option | Description |
|---|---|
--model PATH |
Required. Path to the trained model directory |
--output PATH |
Required. Output GGUF file path |
--method TEXT |
Quantization method (default: q4_0) |
Config file examples¶
Extraction config¶
model:
model_name: "bartowski/Llama-3.2-1B-Instruct-GGUF"
n_ctx: 2048
temperature: 0.0
fields:
name: str
age: int
job_title: str
company: str
prompt_format: llama
max_tokens: 256