Text Generation
Transformers
Safetensors
GGUF
English
gemma3_text
tiny-model
gemma3
from-scratch
conversational
tool-use
agent-harness
calculator
humble-ai
small-language-model
muon
on-device
text-generation-inference
Instructions to use textilelabs/Loom-Swift-Micro-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use textilelabs/Loom-Swift-Micro-3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="textilelabs/Loom-Swift-Micro-3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("textilelabs/Loom-Swift-Micro-3") model = AutoModelForCausalLM.from_pretrained("textilelabs/Loom-Swift-Micro-3", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use textilelabs/Loom-Swift-Micro-3 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-3:F16 # Run inference directly in the terminal: llama cli -hf textilelabs/Loom-Swift-Micro-3:F16
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-3:F16 # Run inference directly in the terminal: llama cli -hf textilelabs/Loom-Swift-Micro-3:F16
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-3:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf textilelabs/Loom-Swift-Micro-3:F16
Use Docker
docker model run hf.co/textilelabs/Loom-Swift-Micro-3:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use textilelabs/Loom-Swift-Micro-3 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-3" # 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-3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/textilelabs/Loom-Swift-Micro-3:F16
- SGLang
How to use textilelabs/Loom-Swift-Micro-3 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-3" \ --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-3", "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-3" \ --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-3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use textilelabs/Loom-Swift-Micro-3 with Ollama:
ollama run hf.co/textilelabs/Loom-Swift-Micro-3:F16
- Unsloth Desktop
- Pi
How to use textilelabs/Loom-Swift-Micro-3 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-3:F16
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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "textilelabs/Loom-Swift-Micro-3:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use textilelabs/Loom-Swift-Micro-3 with Docker Model Runner:
docker model run hf.co/textilelabs/Loom-Swift-Micro-3:F16
- Lemonade
How to use textilelabs/Loom-Swift-Micro-3 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull textilelabs/Loom-Swift-Micro-3:F16
Run and chat with the model
lemonade run user.Loom-Swift-Micro-3-F16
List all available models
lemonade list
- Hermes Agent
How to use textilelabs/Loom-Swift-Micro-3 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-3:F16
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:9931/v1 hermes config set model.default textilelabs/Loom-Swift-Micro-3:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use textilelabs/Loom-Swift-Micro-3 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-3:F16
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:9931/v1 \ --custom-model-id "textilelabs/Loom-Swift-Micro-3:F16" \ --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"
One file, full precision (f16); Ollama template passes whole conversations
Browse files- Modelfile +6 -4
- README.md +7 -9
- loom-swift-micro-3-q4_k_m.gguf +0 -3
- loom-swift-micro-3-q8_0.gguf +0 -3
- template +5 -3
Modelfile
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
-
FROM ./loom-swift-micro-3-
|
| 2 |
TEMPLATE """<tools:off>
|
| 3 |
-
<user>
|
| 4 |
-
{{ .
|
| 5 |
<|eot|>
|
| 6 |
-
<loom>
|
|
|
|
|
|
|
| 7 |
"""
|
| 8 |
PARAMETER stop "<|eot|>"
|
| 9 |
PARAMETER stop "<user>"
|
|
|
|
| 1 |
+
FROM ./loom-swift-micro-3-f16.gguf
|
| 2 |
TEMPLATE """<tools:off>
|
| 3 |
+
{{ range .Messages }}{{ if eq .Role "user" }}<user>
|
| 4 |
+
{{ .Content }}
|
| 5 |
<|eot|>
|
| 6 |
+
{{ else if eq .Role "assistant" }}<loom>
|
| 7 |
+
{{ .Content }}<|eot|>
|
| 8 |
+
{{ end }}{{ end }}<loom>
|
| 9 |
"""
|
| 10 |
PARAMETER stop "<|eot|>"
|
| 11 |
PARAMETER stop "<user>"
|
README.md
CHANGED
|
@@ -42,7 +42,7 @@ It continues [Loom Swift Micro 2](https://huggingface.co/textilelabs/Loom-Swift-
|
|
| 42 |
training rounds on Kaggle's two T4 GPUs. The Swift line was trained from scratch: randomly initialised weights, nothing fine-tuned from anyone's checkpoint.
|
| 43 |
|
| 44 |
> ## Read this first
|
| 45 |
-
> This is a **tiny model for tiny jobs**: about a million parameters,
|
| 46 |
> and decides when a tool is needed. It is **not** a reader, a calculator or an extractor. The "Read this before you use it" section lists every miss we measured.
|
| 47 |
|
| 48 |
## What changed from Swift Micro 2
|
|
@@ -106,8 +106,7 @@ Same tests, same scripts, same settings (repeat penalty 1.0, greedy), through Ol
|
|
| 106 |
|
| 107 |
No job fell by more than 2 items (our "lose nothing" rule for a new version).
|
| 108 |
|
| 109 |
-
|
| 110 |
-
injection resistance is again the least stable part, 0/10 at Q4).
|
| 111 |
|
| 112 |
## Every Loom text model
|
| 113 |
|
|
@@ -138,12 +137,12 @@ Every point was measured on our own held-out tests.
|
|
| 138 |
- **It is a talker, not a worker.** Calculator calls 11/40, dates 4/10, reading a passage 8/60, extraction and redaction 0. Do not use it for calculation, extraction or redaction.
|
| 139 |
- **Two small slips against Swift Micro 2**, each within our 2-item allowance: ignoring an instruction hidden inside a passage (4/10 β 2/10) and calculator calls (13/40 β 11/40). On the battery it admits an unknowable 4/8 (was 5/8).
|
| 140 |
- **Its "(sure)" is still unreliable**: right 47% of the time it says it.
|
| 141 |
-
- It remembers what you said **within one chat** (2,048 tokens); it has no memory between chats.
|
| 142 |
- Replies are one or two short sentences.
|
| 143 |
|
| 144 |
## Usage β phone and desktop chat apps (PocketPal, LM Studio, Jan)
|
| 145 |
|
| 146 |
-
Download `loom-swift-micro-3-
|
| 147 |
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.
|
| 148 |
|
| 149 |
## Usage β the harness (search, calculator, date)
|
|
@@ -161,10 +160,10 @@ Stdlib only; Wikipedia needs no key. Calculator and date calls run locally; a ca
|
|
| 161 |
|
| 162 |
```bash
|
| 163 |
ollama run hf.co/textilelabs/Loom-Swift-Micro-3 "who are you"
|
| 164 |
-
llama-cli -m loom-swift-micro-3-
|
| 165 |
```
|
| 166 |
|
| 167 |
-
`template` and `params` are read automatically by Ollama. **Do not add a repetition penalty.**
|
| 168 |
|
| 169 |
## Usage β transformers (4.50 or newer)
|
| 170 |
|
|
@@ -199,8 +198,7 @@ Raw format (tools on or off): `<tools:off>\n<user>\n{message}\n<|eot|>\n<loom>\n
|
|
| 199 |
```
|
| 200 |
model.safetensors / config.json the model (transformers)
|
| 201 |
tokenizer.json / tokenizer_config.json tokenizer + chat template
|
| 202 |
-
loom-swift-micro-3-f16.gguf
|
| 203 |
-
loom-swift-micro-3-q8_0.gguf / -q4_k_m.gguf phone builds (1.4 MB / 1.2 MB)
|
| 204 |
template / params / Modelfile Ollama
|
| 205 |
harness.py runnable harness β search, calculator, date; stdlib only
|
| 206 |
ATTRIBUTION.md required credits for the training data
|
|
|
|
| 42 |
training rounds on Kaggle's two T4 GPUs. The Swift line was trained from scratch: randomly initialised weights, nothing fine-tuned from anyone's checkpoint.
|
| 43 |
|
| 44 |
> ## Read this first
|
| 45 |
+
> This is a **tiny model for tiny jobs**: about a million parameters, one 2.5 MB file. It chats briefly and kindly, knows its limits,
|
| 46 |
> and decides when a tool is needed. It is **not** a reader, a calculator or an extractor. The "Read this before you use it" section lists every miss we measured.
|
| 47 |
|
| 48 |
## What changed from Swift Micro 2
|
|
|
|
| 106 |
|
| 107 |
No job fell by more than 2 items (our "lose nothing" rule for a new version).
|
| 108 |
|
| 109 |
+
**One file, full precision.** At this size a quantised file saves only a megabyte or so and loses a few items (we measured it), so we ship just the best version: `loom-swift-micro-3-f16.gguf`, 2.5 MB.
|
|
|
|
| 110 |
|
| 111 |
## Every Loom text model
|
| 112 |
|
|
|
|
| 137 |
- **It is a talker, not a worker.** Calculator calls 11/40, dates 4/10, reading a passage 8/60, extraction and redaction 0. Do not use it for calculation, extraction or redaction.
|
| 138 |
- **Two small slips against Swift Micro 2**, each within our 2-item allowance: ignoring an instruction hidden inside a passage (4/10 β 2/10) and calculator calls (13/40 β 11/40). On the battery it admits an unknowable 4/8 (was 5/8).
|
| 139 |
- **Its "(sure)" is still unreliable**: right 47% of the time it says it.
|
| 140 |
+
- It remembers what you said **within one chat** (2,048 tokens); it has no memory between chats. Its copying is imperfect: "I'm Tavira", "My name is Oskar" and "call me Bree" come back right, but "I am Tavira" comes back as "Your name is am Tavira".
|
| 141 |
- Replies are one or two short sentences.
|
| 142 |
|
| 143 |
## Usage β phone and desktop chat apps (PocketPal, LM Studio, Jan)
|
| 144 |
|
| 145 |
+
Download `loom-swift-micro-3-f16.gguf` (2.5 MB) and load it. The chat template and the stop token are inside the file.
|
| 146 |
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.
|
| 147 |
|
| 148 |
## Usage β the harness (search, calculator, date)
|
|
|
|
| 160 |
|
| 161 |
```bash
|
| 162 |
ollama run hf.co/textilelabs/Loom-Swift-Micro-3 "who are you"
|
| 163 |
+
llama-cli -m loom-swift-micro-3-f16.gguf --jinja -cnv # uses the template in the GGUF
|
| 164 |
```
|
| 165 |
|
| 166 |
+
`template` (whole conversations, so it remembers earlier turns) and `params` are read automatically by Ollama. **Do not add a repetition penalty.**
|
| 167 |
|
| 168 |
## Usage β transformers (4.50 or newer)
|
| 169 |
|
|
|
|
| 198 |
```
|
| 199 |
model.safetensors / config.json the model (transformers)
|
| 200 |
tokenizer.json / tokenizer_config.json tokenizer + chat template
|
| 201 |
+
loom-swift-micro-3-f16.gguf full precision GGUF (2.5 MB): phones, desktop apps, Ollama, llama.cpp
|
|
|
|
| 202 |
template / params / Modelfile Ollama
|
| 203 |
harness.py runnable harness β search, calculator, date; stdlib only
|
| 204 |
ATTRIBUTION.md required credits for the training data
|
loom-swift-micro-3-q4_k_m.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:0539b6ad26ffdef89c6c452c06141cf68499a625a3f021e71a788efce321612f
|
| 3 |
-
size 1150752
|
|
|
|
|
|
|
|
|
|
|
|
loom-swift-micro-3-q8_0.gguf
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:aed20ab9618fff6d1c6a2897c2dcdf5a3d7ceea43c49b751fa9824e3d9de9866
|
| 3 |
-
size 1399584
|
|
|
|
|
|
|
|
|
|
|
|
template
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
<tools:off>
|
| 2 |
-
<user>
|
| 3 |
-
{{ .
|
| 4 |
<|eot|>
|
| 5 |
-
<loom>
|
|
|
|
|
|
|
|
|
| 1 |
<tools:off>
|
| 2 |
+
{{ range .Messages }}{{ if eq .Role "user" }}<user>
|
| 3 |
+
{{ .Content }}
|
| 4 |
<|eot|>
|
| 5 |
+
{{ else if eq .Role "assistant" }}<loom>
|
| 6 |
+
{{ .Content }}<|eot|>
|
| 7 |
+
{{ end }}{{ end }}<loom>
|