Instructions to use textilelabs/Loom-Spark with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use textilelabs/Loom-Spark with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="textilelabs/Loom-Spark")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("textilelabs/Loom-Spark") model = AutoModelForCausalLM.from_pretrained("textilelabs/Loom-Spark", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use textilelabs/Loom-Spark 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-Spark:F32 # Run inference directly in the terminal: llama cli -hf textilelabs/Loom-Spark:F32
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf textilelabs/Loom-Spark:F32 # Run inference directly in the terminal: llama cli -hf textilelabs/Loom-Spark:F32
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-Spark:F32 # Run inference directly in the terminal: ./llama-cli -hf textilelabs/Loom-Spark:F32
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-Spark:F32 # Run inference directly in the terminal: ./build/bin/llama-cli -hf textilelabs/Loom-Spark:F32
Use Docker
docker model run hf.co/textilelabs/Loom-Spark:F32
- LM Studio
- Jan
- vLLM
How to use textilelabs/Loom-Spark with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "textilelabs/Loom-Spark" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "textilelabs/Loom-Spark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/textilelabs/Loom-Spark:F32
- SGLang
How to use textilelabs/Loom-Spark 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-Spark" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "textilelabs/Loom-Spark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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-Spark" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "textilelabs/Loom-Spark", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use textilelabs/Loom-Spark with Ollama:
ollama run hf.co/textilelabs/Loom-Spark:F32
- Unsloth Studio
How to use textilelabs/Loom-Spark with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for textilelabs/Loom-Spark to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for textilelabs/Loom-Spark to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for textilelabs/Loom-Spark to start chatting
- Docker Model Runner
How to use textilelabs/Loom-Spark with Docker Model Runner:
docker model run hf.co/textilelabs/Loom-Spark:F32
- Lemonade
How to use textilelabs/Loom-Spark with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull textilelabs/Loom-Spark:F32
Run and chat with the model
lemonade run user.Loom-Spark-F32
List all available models
lemonade list
- Atomic Chat
Loom Spark Harness
The agent harness for Loom Spark (Textile Labs). Loom Spark is a ~7.6M-parameter model trained to be humble, self-aware, and curious instead of encyclopedic. Its one real superpower is forming clean search queries — this harness is what turns that into actual internet access.
It implements the tool protocol the model was trained on:
<tools:on> | <tools:off> mode header, set by the harness each session
<lookup>query</lookup> emitted by the model; harness runs a real search
<result>text</result> injected by the harness; model then summarizes
With tools off, the model never emits lookup tags (banned at the logits level
and string-stripped as a safety net). With tools on, the harness owns the
<result> slot entirely — the model cannot hallucinate one.
Install
pip install . # from this folder (or the harness/ folder of the HF repo)
Works on Python 3.9 through 3.13 (CPU torch wheels exist for all of them).
Optional: pip install ".[logo]" adds Pillow so the terminal banner renders
the Textile Labs avatar in truecolor blocks; without it you get a clean ASCII
mark instead.
Terminal chat
loom-chat # auto-finds a local export dir or pulls
# TextileLabs/loom-spark from the hub
loom-chat --offline # start with tools off
loom-chat --backend duckduckgo # search backend: mock | duckduckgo
loom-chat --model path/or/org-name
loom-chat --plain # no colors / artwork
In-chat commands: /online /offline /backend NAME /reset /quit.
Web GUI
loom-web --port 7860 # then open http://localhost:7860
Local-only chat page (stdlib HTTP server) with a tools-on/off switch, token streaming, and a live feed of internet lookups.
Model resolution
--model wins; else $LOOM_MODEL; else an export/loom-spark-hf directory
next to the package or in the cwd; else the hub id TextileLabs/loom-spark.
Accepted values: HF export directory, .pt training checkpoint (needs the
training repo importable), or any org/name hub id.
Search backends
| name | internet | notes |
|---|---|---|
mock |
no | canned curriculum-style results; demos & tests |
duckduckgo |
yes | keyless scrape of DDG's HTML endpoint; stdlib only |
A backend maps query → plain text, or None when unreachable — the model was
trained to fall back gracefully on empty results. Add your own by subclassing
loomspark_harness.search.base.SearchBackend (e.g. Brave/Serper with an API
key) and registering it in search/__init__.py.
The web GUI header and the CLI banner use static/logo.png (the Textile Labs
founder's avatar). Replace that file to rebrand.
Troubleshooting
Intel (x86_64) Macs: PyTorch stopped shipping Intel-macOS wheels at 2.2.2,
and the newest numpy/transformers are incompatible with it. Install
era-matched pins instead of plain pip install torch transformers:
pip install "numpy<2" "torch==2.2.2" "transformers<5" tokenizers pillow
Using the agent from Python
from loomspark_harness.loader import load_model_and_tokenizer
from loomspark_harness.agent import LoomAgent
from loomspark_harness.search import get_backend
model, tok, block = load_model_and_tokenizer("TextileLabs/loom-spark")
agent = LoomAgent(model, tok, backend=get_backend("duckduckgo"),
online=True, block_size=block)
print(agent.reply("what year did the Titanic sink?")["text"])
reply() returns {"text", "query", "result"}; pass on_event= for a
callback stream of token / preamble / lookup / result / done events
(the web GUI is built on this).
License
MIT — see LICENSE.