Instructions to use textilelabs/Loom-Weave-2-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use textilelabs/Loom-Weave-2-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="textilelabs/Loom-Weave-2-Flash") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("textilelabs/Loom-Weave-2-Flash") model = AutoModelForCausalLM.from_pretrained("textilelabs/Loom-Weave-2-Flash", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use textilelabs/Loom-Weave-2-Flash 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-Weave-2-Flash:F16 # Run inference directly in the terminal: llama cli -hf textilelabs/Loom-Weave-2-Flash:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf textilelabs/Loom-Weave-2-Flash:F16 # Run inference directly in the terminal: llama cli -hf textilelabs/Loom-Weave-2-Flash:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf textilelabs/Loom-Weave-2-Flash:F16 # Run inference directly in the terminal: ./llama-cli -hf textilelabs/Loom-Weave-2-Flash:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf textilelabs/Loom-Weave-2-Flash:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf textilelabs/Loom-Weave-2-Flash:F16
Use Docker
docker model run hf.co/textilelabs/Loom-Weave-2-Flash:F16
- LM Studio
- Jan
- vLLM
How to use textilelabs/Loom-Weave-2-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "textilelabs/Loom-Weave-2-Flash" # 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-Weave-2-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/textilelabs/Loom-Weave-2-Flash:F16
- SGLang
How to use textilelabs/Loom-Weave-2-Flash 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-Weave-2-Flash" \ --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-Weave-2-Flash", "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-Weave-2-Flash" \ --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-Weave-2-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use textilelabs/Loom-Weave-2-Flash with Ollama:
ollama run hf.co/textilelabs/Loom-Weave-2-Flash:F16
- Unsloth Desktop
- Docker Model Runner
How to use textilelabs/Loom-Weave-2-Flash with Docker Model Runner:
docker model run hf.co/textilelabs/Loom-Weave-2-Flash:F16
- Lemonade
How to use textilelabs/Loom-Weave-2-Flash with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull textilelabs/Loom-Weave-2-Flash:F16
Run and chat with the model
lemonade run user.Loom-Weave-2-Flash-F16
List all available models
lemonade list
- Atomic Chat
Loom Weave 2 Flash
19.9M parameters Β· 512 context Β· Textile Labs
The same architecture and corpus as Loom Spark 2, trained for two hours instead of one. Twice the optimiser steps, one variable changed.
Trained from scratch on a 2013 desktop CPU β randomly initialised weights, nothing fine-tuned from a pretrained base.
who are you β Loom, a small model from Textile Labs.
WHO ARE YOU??? β Loom, a small model from Textile Labs.
what is my sisters name β I can't know that unless you tell me.
i had a rough day β That sounds heavy. Want to talk about it?
What the second hour bought
Identical battery, identical prompts, one variable β training time.
| Spark 1.8 | Spark 2 (1h) | Weave 2 Flash (2h) | |
|---|---|---|---|
offline <lookup> leak |
16/30 Β· 53% | 0/30 | 0/30 |
| clean single online lookup | 8/10 | 10/10 | 10/10 |
| identity correct | β | 12/12 | 12/12 |
| identity under CAPS / typos / filler | not trained for | 6/6 | 5/6 |
| admits an unknowable personal fact | β | 4/8 | 6/8 |
answers from a supplied <result> |
β | 2/5 | 3/5 |
| says the result doesn't contain it | β | 0/4 | 0/4 |
| self-termination without a Modelfile | needed one | 12/12 | 12/12 |
| validation loss Β· accuracy | β | 2.69 Β· 0.536 | 2.25 Β· 0.589 |
809 steps β 1,645 steps. Calibration and grounded reading both improved; loss and accuracy improved clearly.
The one thing more training did not fix
says the result doesn't contain it stayed at 0/4. Twice the training, identical zero.
That is worth publishing rather than hiding, because it rules something out. Nearly a third of the training corpus β 30,000 human-written examples β is exactly this behaviour, and 3.3M additional tokens moved it not at all, while every neighbouring metric moved.
So this is not under-training. The likely reason: saying "the result doesn't say" requires
detecting an absence β reading the whole result and concluding the answer is not in it.
That is a harder computation than extracting a span that is present, and at 20M parameters
it appears to be out of reach. By contrast unknowable (6/8) only needs to notice "my" or
"I" in the question.
Practical consequence: if you feed this model a result, it will answer from it whether or
not the answer is there. Validate the output. Treat the retrieved <result> as the
trustworthy part and the model's summary of it as unreliable.
It also has almost no world knowledge. With tools off it declines factual questions, which is intended behaviour rather than a fault.
Two modes
<tools:off> (default) β conversational. Identity, limits, warmth, brevity. No harness
needed.
<tools:on> β emits <lookup>query</lookup> and stops. Your harness runs the lookup and
continues with a <result> block:
<tools:on>
<user>
what is the capital of Peru
<|eot|>
<loom>
<lookup>what is the capital of Peru</lookup><|eot|>
<result>
Lima is the capital and largest city of Peru.
<|eot|>
<loom>
The persona slice was trained entirely under tools:off, so identity questions asked with
tools on will often be turned into a lookup. Keep tools off for chat.
Usage β the harness
harness.py in this repo runs the lookup Loom asks for and feeds the result back.
Wikipedia is used because it is free and needs no key β swap the search() function for
anything else; the contract is text in, text out.
python3 harness.py "who wrote Dracula" # with lookups
python3 harness.py # interactive
python3 harness.py --no-tools "who are you" # chat only
Three things any harness for this model needs:
- Never feed a failed lookup back as a
<result>. The model will earnestly try to answer from the error text. Fail loudly instead βharness.pydoes. - Wikipedia returns 403 without a descriptive
User-Agent. - macOS system Python often needs certifi for TLS.
Usage β Ollama
ollama run hf.co/textilelabs/Loom-Weave-2-Flash "who are you"
# Loom, a small model from Textile Labs.
Ollama reads the template and params files in this repo β nothing to set up. The
template defaults to tools:off. To build locally:
ollama create loom-weave-2-flash -f Modelfile.
Usage β transformers
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("textilelabs/Loom-Weave-2-Flash")
model = AutoModelForCausalLM.from_pretrained("textilelabs/Loom-Weave-2-Flash").eval()
eot = tok.convert_tokens_to_ids("<|eot|>")
def ask(message, tools=False):
p = f"<tools:{'on' if tools else 'off'}>\n<user>\n{message}\n<|eot|>\n<loom>\n"
ids = tok(p, return_tensors="pt", add_special_tokens=False).input_ids
with torch.no_grad():
out = model.generate(ids, max_new_tokens=64, do_sample=False, eos_token_id=eot,
pad_token_id=tok.convert_tokens_to_ids("<|pad|>"))[0]
return tok.decode(out[ids.shape[1]:], skip_special_tokens=True).strip()
ask("who are you") # -> 'Loom, a small model from Textile Labs.'
Prompt format is exact: <tools:off>\n<user>\n{message}\n<|eot|>\n<loom>\n.
Which one should I use?
This one, unless you specifically want the one-hour model. It is better on calibration, grounded reading, and both loss metrics, and marginally worse on a single identity probe. Spark 2 exists as the one-hour tier and as the control in this comparison.
Files
config.json / model.safetensors the model
tokenizer.json / tokenizer_config.json custom BPE tokenizer, 4,096 tokens
loom-weave-2-flash-f16.gguf 40MB, for Ollama / llama.cpp
harness.py runnable harness β runs lookups, feeds results back
template / params read automatically by `ollama run hf.co/...`
Modelfile for building locally
ATTRIBUTION.md required credits for the training corpora
Training data
Openly licensed corpora of real human text, plus a persona curriculum written for Loom.
See ATTRIBUTION.md β several of these licences require credit.
| slice | source |
|---|---|
| grounded reading, and "the result doesn't say" | SQuAD 2.0 (CC BY-SA 4.0) |
| when to reach for a tool | MASSIVE (CC BY 4.0) Β· CLINC150 (CC BY 3.0) |
| instruction following | databricks-dolly-15k (CC BY-SA 3.0) |
| multi-turn dialogue structure | OpenAssistant OASST1 (Apache 2.0) |
| identity, limits, warmth, brevity | Textile Labs β written for Loom |
~11.4M tokens, 43% multi-turn. Validation is a held-out split of the same corpora.
License
Model: MIT. Training data retains its original licences and attribution.
- Downloads last month
- 213