Instructions to use textilelabs/Loom-Swift-Micro-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use textilelabs/Loom-Swift-Micro-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="textilelabs/Loom-Swift-Micro-2")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("textilelabs/Loom-Swift-Micro-2") model = AutoModelForCausalLM.from_pretrained("textilelabs/Loom-Swift-Micro-2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use textilelabs/Loom-Swift-Micro-2 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M # Run inference directly in the terminal: llama cli -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M # Run inference directly in the terminal: llama cli -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M
Use Docker
docker model run hf.co/textilelabs/Loom-Swift-Micro-2:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use textilelabs/Loom-Swift-Micro-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "textilelabs/Loom-Swift-Micro-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "textilelabs/Loom-Swift-Micro-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/textilelabs/Loom-Swift-Micro-2:Q4_K_M
- SGLang
How to use textilelabs/Loom-Swift-Micro-2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "textilelabs/Loom-Swift-Micro-2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "textilelabs/Loom-Swift-Micro-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "textilelabs/Loom-Swift-Micro-2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "textilelabs/Loom-Swift-Micro-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use textilelabs/Loom-Swift-Micro-2 with Ollama:
ollama run hf.co/textilelabs/Loom-Swift-Micro-2:Q4_K_M
- Unsloth Desktop
- Pi
How to use textilelabs/Loom-Swift-Micro-2 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "textilelabs/Loom-Swift-Micro-2:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use textilelabs/Loom-Swift-Micro-2 with Docker Model Runner:
docker model run hf.co/textilelabs/Loom-Swift-Micro-2:Q4_K_M
- Lemonade
How to use textilelabs/Loom-Swift-Micro-2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull textilelabs/Loom-Swift-Micro-2:Q4_K_M
Run and chat with the model
lemonade run user.Loom-Swift-Micro-2-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use textilelabs/Loom-Swift-Micro-2 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default textilelabs/Loom-Swift-Micro-2:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use textilelabs/Loom-Swift-Micro-2 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf textilelabs/Loom-Swift-Micro-2:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "textilelabs/Loom-Swift-Micro-2:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Loom Swift Micro 2
- What changed from the original
- Measured against the original
- Every Loom text model
- Read this before you use it
- Usage β phone and desktop chat apps (PocketPal, LM Studio, Jan)
- Usage β the harness (search, calculator, date)
- Usage β Ollama / llama.cpp
- Usage β transformers (4.50 or newer)
- How it was built
- Files
- License
- What changed from the original
Loom Swift Micro 2
1,172,832 parameters Β· 12 layers Γ 96d Β· 2K context Β· runs on phones Β· Textile Labs
Loom Swift Micro 2 is a 1.17-million-parameter model trained for five minutes. It is the smallest Loom: it chats briefly, knows who it is, declines what it can't know, and writes calculator and date calls β and it runs in phone apps. It is the second generation of Loom Swift Micro, retrained on Kaggle's two T4 GPUs for the same 5 minutes the original spent on a CPU, and rebuilt on the Gemma-3 layout so it runs in PocketPal, LM Studio, Jan, llama.cpp and Ollama straight from the GGUF. Trained from scratch: randomly initialised weights, nothing fine-tuned from anyone's checkpoint.
Read this first
This is a tiny model for tiny jobs, and it is honest about the limits we measured. It is not a reader and it is not a reasoner. What it does is: say who it is, decide when a tool is needed, write a calculator / date / search call, and (Mini) label and extract from short text. It is published as a small, fast, on-device experiment β not as a strict upgrade. The "Read this before you use it" section below lists every miss.
What changed from the original
| Loom Swift Micro | Loom Swift Micro 2 | |
|---|---|---|
| layout | Llama | Gemma-3 style (local sliding window + a global layer every 6th) |
| tokenizer | 4,096 BPE | 4,096 BPE rebuilt, every digit its own token, identical in llama.cpp |
| context | 512 | 2,048 |
| runs in phone/desktop chat apps | no | yes β chat template and end-of-turn built into the GGUF |
| new jobs | β | calculator calls, date arithmetic, labelling, extraction, redaction, reading a search result |
| trained on | a 2013 office CPU | Kaggle 2 Γ T4 |
| training time | 10 / 5 minutes | the same: 5 minutes of training |
Measured against the original
Same tests, same scripts, same settings (repeat penalty 1.0), both through Ollama. Every test prompt is scrubbed from the training data.
The Loom acceptance battery, row by row:
| row | original | Loom Swift Micro 2 |
|---|---|---|
| A Β· says its own name | 11/12 | 11/12 |
| B Β· its own name under rough typing | 11/12 | 11/12 |
| C Β· 5-turn conversation stays on thread | 5/5 | 5/5 |
| D Β· answers from a search result | 0/5 | 3/5 |
| E Β· follow-up answered from the same result | 0/5 | 0/5 |
| F Β· says it looked, after a lookup | 5/5 | 0/5 |
| G Β· never claims a lookup it didn't make | 16/16 | 16/16 |
| H Β· admits what it can't know about you | 7/8 | 5/8 |
| I Β· says when a result doesn't contain the answer | 0/5 | 3/5 |
| J Β· never leaks a search tag with tools off | 28/28 | 28/28 |
| K Β· stops on its own | 12/12 | 12/12 |
| L Β· searches when it should | 15/20 | 16/20 |
| total | 110/133 | 110/133 |
New jobs (our own frozen test set; the original Swifts never trained on most of these, so most of their zeros are expected):
| job (275 held-out items, each prompt scrubbed from training) | original Swift Micro | Swift Micro 2 |
|---|---|---|
| everyday chat | 4/15 | 11/15 |
| declining an unknown fact, tools off (strict scorer) | 18/20* | 18/20 |
| ignoring an instruction inside a passage | 0/10 | 4/10 |
| labelling (topic / language / sentiment / toxic / route) | 0/60 | 28/60 |
| calculator call correct | 0/40 | 13/40 |
| date arithmetic | 0/10 | 3/10 |
| reading a retrieved passage | 0/60 | 4/60 |
| typed extraction | 0/30 | 0/30 |
| redaction (exact match) | 0/30 | 0/30 |
| saying "(sure)" and being right | β | 22% of 82 |
*the original was scored with a looser scorer.
Q8_0 and Q4_K_M behave the same within a few items (Q8: label 30/60, inject 5/10; Q4: label 27/60, inject 1/10 β injection resistance is the least stable part).
Every Loom text model
| model | params | battery /133 | live search (held-out) | reads real prose | runs in phone apps |
|---|---|---|---|---|---|
| Loom Spark 2 | 19.9M | ~97 | 2/20 | no | no |
| Loom Tapestry 2 | 22.8M | 107 | β | curated only | no |
| Loom Tapestry 3 Flash | 7.18M | 112 | 3/20 | curated only | no |
| Loom Spark 3 Flash | 7.18M | 119 | 5/20 | curated only | no |
| Loom Spark 3 | 12.2M | 120 | 7/20 | curated only | no |
| Loom Spark 3.2 | 22.8M | 122β | 7/20 | curated only | no |
| Loom Weave 3 | 31.5M | 120 | 6/20 | yes | no |
| Loom Tapestry 3 | 69.2M | 123 | 12/20 | yes + multi-hop | no |
| Loom Crucible Preview | 155.0M | 125β | 10/20 | yes β best curated reader | no |
| Loom Weave 4 | 55.6M | 127β | 10/20 | yes | yes |
| Loom Swift Mini (original) | 2.0M | 110β‘ | β | no | no |
| Loom Swift Micro (original) | 1.16M | 110β‘ | β | no | no |
| Loom Swift Mini 2 | 2.0M | 120 | not measured | barely (12% on 200β1,500-token passages) | yes |
| Loom Swift Micro 2 | 1.17M | 110 | not measured | barely (7%) | yes |
β scored on a battery with every test prompt scrubbed from training. β‘ the two original Swifts re-scored today with the same script and settings as the Swift 2s (their release scores were 106 and 104). Earlier rows are each model's release score. Never compare scores from different command lines.
Read this before you use it
Every point was measured on our own held-out tests.
- It is weaker than Swift Mini 2 at almost everything. Calculator calls 13/40, dates 3/10, labelling 28/60, reading 4/60, extraction and redaction 0.
- On the acceptance battery it ties the original (110/133) and is worse in two places: attribution after a lookup went from 5/5 to 0/5 and admitting an unknowable from 7/8 to 5/8. It is better at reading a result (3/5 vs 0/5) and at saying a result doesn't contain the answer (3/5 vs 0/5).
- Its "(sure)" is nearly meaningless: right 22% of the time it says it.
- Do not use it for calculation, extraction or redaction. It is here for what a 1-million-parameter file can do in five minutes of training: answer who it is, chat briefly, decline, and decide when a tool is needed.
- Replies are one or two short sentences. 2,048 tokens of context.
Usage β phone and desktop chat apps (PocketPal, LM Studio, Jan)
Download loom-swift-micro-2-q4_k_m.gguf (1.2 MB) or loom-swift-micro-2-q8_0.gguf (1.4 MB) and load it. The chat template and the stop token are inside the file.
Set repeat penalty 1.0. The model only writes tool calls (<tool>calc 482 + 539</tool>); a chat app will not run them for you β use the harness for that.
Usage β the harness (search, calculator, date)
python3 harness.py "whats the capital of peru"
python3 harness.py "what is 482 + 539"
python3 harness.py --show "who wrote hamlet" # see what it searched and read
python3 harness.py --no-tools "who are you"
Stdlib only; Wikipedia needs no key. Calculator and date calls run locally; a calculator error comes back as error. Never feed a failed lookup back as a result β the model answers from the error text.
Usage β Ollama / llama.cpp
ollama run hf.co/textilelabs/Loom-Swift-Micro-2 "who are you"
llama-cli -m loom-swift-micro-2-q8_0.gguf --jinja -cnv # uses the template in the GGUF
template and params are read automatically by Ollama. Do not add a repetition penalty.
Usage β transformers (4.50 or newer)
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("textilelabs/Loom-Swift-Micro-2")
model = AutoModelForCausalLM.from_pretrained("textilelabs/Loom-Swift-Micro-2").eval()
prompt = tok.apply_chat_template([{"role": "user", "content": "who are you"}], tokenize=False, add_generation_prompt=True)
ids = tok(prompt, return_tensors="pt", add_special_tokens=False).input_ids
out = model.generate(ids, max_new_tokens=120, do_sample=False)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
Raw format (tools on or off): <tools:off>\n<user>\n{message}\n<|eot|>\n<loom>\n.
How it was built
| architecture | Gemma-3 layout: 12 layers Γ 96d (10 sliding-window 512 + 2 global), 2 query heads / 1 KV head of 32, GeGLU 160, tied embeddings, QK-norm |
| parameters | 1,172,832 |
| vocabulary | 4,096 byte-level BPE, single digits, Qwen2-style pre-tokenizer (identical tokens in llama.cpp) |
| training | 5 minutes from random init, 608 steps, 40M tokens at 2,048 context; a second, focused phase for the last third |
| optimiser | Muon on 2-D hidden matrices, AdamW on embeddings and norms; per-conversation attention masking |
| attention check | before the run, the trainer's attention is checked against the reference implementation (loss and gradients identical) |
| hardware | Kaggle, 2 Γ NVIDIA T4 |
Files
model.safetensors / config.json the model (transformers)
tokenizer.json / tokenizer_config.json tokenizer + chat template
loom-swift-micro-2-f16.gguf full precision GGUF (2.5 MB)
loom-swift-micro-2-q8_0.gguf / -q4_k_m.gguf phone builds (1.4 MB / 1.2 MB)
template / params / Modelfile Ollama
harness.py runnable harness β search, calculator, date; stdlib only
ATTRIBUTION.md required credits for the training data
License
Model: MIT. Training data keeps its original licences β see ATTRIBUTION.md.
- Downloads last month
- 586