Instructions to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit") model = AutoModelForMultimodalLM.from_pretrained("JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Transformers.js
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('image-text-to-text', 'JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit 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 JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16 # Run inference directly in the terminal: llama cli -hf JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16 # Run inference directly in the terminal: llama cli -hf JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
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 JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16 # Run inference directly in the terminal: ./build/bin/llama cli -hf JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
Use Docker
docker model run hf.co/JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
- Llama new
- LM Studio
- Jan
- vLLM
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
- SGLang
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit 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 "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit" \ --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": "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit" \ --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": "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Ollama
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with Ollama:
ollama run hf.co/JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
- Unsloth Desktop
- Pi
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
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": "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with Docker Model Runner:
docker model run hf.co/JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
- Lemonade
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
Run and chat with the model
lemonade run user.Qwen3.5-0.8B-Astra-WeightEdit-BF16
List all available models
lemonade list
- Hermes Agent
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
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 JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
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 "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16" \ --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"
Qwen3.5-0.8B: Astra Weight Edit
Qwen3.5-0.8B with 2 tensors edited directly by an LLM (GPT-6 Astra), with no training. This fixes the model's thinking-mode repeat loops.
All credit goes to Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab (MIT CSAIL). I only applied their released diff and checked that it matches their evaluated checkpoint hash for hash. Not affiliated with or endorsed by the authors, OpenAI or Qwen.
- π Blog: Sparks of Weight-Space Programming (Experiment 8)
- π¦ Logs + edit: RikiyaT/lm_understand-logs (
exp8_math/runs/p50c/edit, also copied intoastra_edit/)
What changed
The loop direction was subtracted from 64 output columns of mlp.down_proj in layers 15 and 19 (about 130k weights,
0.016% of the model). Everything else is byte-identical to the base model.
How to run
The edit only helps with thinking on. The chat template turns thinking off unless you pass
enable_thinking=True. Recommended sampling (the paper's): temperature 0.6, top_p 0.95, top_k 20, presence penalty 1.5.
| You want to run it in⦠| Use | Files |
|---|---|---|
| Python, GPU servers | π€ Transformers / vLLM / SGLang | model.safetensors-* (bf16) |
| The browser (WebGPU) or Node.js | π€ Transformers.js | onnx/* |
| Any ONNX Runtime app (C#, C++, Java, mobileβ¦) | ONNX Runtime | onnx/* |
| A laptop / CPU / Mac, local apps | llama.cpp, LM Studio, Ollama, Jan⦠| Qwen3.5-0.8B-Astra-WeightEdit-BF16.gguf |
Transformers (Python)
from transformers import AutoModelForImageTextToText, AutoTokenizer
repo = "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForImageTextToText.from_pretrained(repo, dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "What is 17 * 23? Please reason step by step, and put your final answer within \\boxed{}."}]
inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, enable_thinking=True,
return_tensors="pt", return_dict=True).to(model.device)
out = model.generate(**inputs, max_new_tokens=4096, do_sample=True, temperature=0.6, top_p=0.95, top_k=20)
print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
vLLM
vllm serve JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit
# then send chat requests with: "chat_template_kwargs": {"enable_thinking": true}
Transformers.js (browser / Node.js)
npm i @huggingface/transformers@next
import { AutoProcessor, Qwen3_5ForConditionalGeneration, TextStreamer } from "@huggingface/transformers";
const repo = "JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit";
const processor = await AutoProcessor.from_pretrained(repo);
const model = await Qwen3_5ForConditionalGeneration.from_pretrained(repo, {
dtype: { embed_tokens: "fp16", vision_encoder: "fp16", decoder_model_merged: "fp16" },
device: "webgpu", // or "wasm" in the browser, "cpu" in Node.js (use "quantized" there)
});
const messages = [{ role: "user", content: "What is 17 * 23? Please reason step by step, and put your final answer within \\boxed{}." }];
const text = processor.apply_chat_template(messages, { add_generation_prompt: true, enable_thinking: true });
const inputs = await processor(text);
await model.generate({
...inputs, max_new_tokens: 4096, do_sample: true, temperature: 0.6, top_p: 0.95, top_k: 20,
streamer: new TextStreamer(processor.tokenizer, { skip_prompt: true, skip_special_tokens: true }),
});
Which dtype to pick (each graph comes in all five; size is the language-model decoder):
| dtype | decoder size | Best for | Agrees with bf16* |
|---|---|---|---|
fp32 |
3.0 GB | reference | 100% |
fp16 |
1.5 GB | WebGPU | 100% |
quantized (int8) |
0.87 GB | CPU / WASM | 100% |
q4f16 |
0.44 GB | smallest download, WebGPU | ~69% |
q4 |
0.48 GB | smallest download, CPU / WASM | ~69% |
*Next-token argmax agreement with the PyTorch model over a 35-token prompt (spot check). The 4-bit builds lose about as much against the bf16 base model as they do here, so treat them as noticeably lossy at this size.
llama.cpp / LM Studio / Ollama (GGUF)
# llama.cpp
llama-cli -hf JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16 \
--jinja --chat-template-kwargs '{"enable_thinking":true}' \
--temp 0.6 --top-p 0.95 --top-k 20 --presence-penalty 1.5 -c 32768
# Ollama (a version with Qwen3.5 support)
ollama run hf.co/JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit:BF16
LM Studio: search for JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit. Only a BF16 GGUF is provided (1.56 GB). This is
text only: no mmproj vision file.
How the ONNX and GGUF files were made
Neither was re-exported. I took existing conversions of the same base revision and rewrote only the two edited tensors, so every other byte matches those well-tested builds:
- ONNX: onnx-community/Qwen3.5-0.8B-ONNX-OPT
@
9a4c21d8. Thedown_projtensors of layers 15 and 19 are overwritten in place in eachdecoder_model_merged*data file. Before writing, the script regenerates the base tensors from the bf16 weights and requires a byte-for-byte match with the shipped files in all five dtypes, including the int8/int4 block quantization. So the edited bytes are exactly what that export pipeline would have produced.embed_tokens*andvision_encoder*are unchanged copies. - GGUF: ggml-org/Qwen3.5-0.8B-GGUF
Qwen3.5-0.8B-BF16.gguf@807dfd9a, converted from Qwen revision2fc06364.blk.{15,19}.ffn_down.weightare swapped after checking that the base bytes match the base sha256 inastra_edit/manifest.json. The edited bytes match the edited sha256. Onlygeneral.name,general.repo_urland the base-model metadata were changed. - Checks: the ONNX fp32/fp16/int8 logits match PyTorch (mean KL β€ 6e-4, same argmax). Transformers.js fp32 greedy output is token-for-token identical to PyTorch over 120 tokens.
- Scripts:
conversion/.
The root config.json gained a transformers.js_config block, and a minimal generation_config.json
(eos_token_id: [<|im_end|>, <|endoftext|>], no sampling defaults) was added so generation stops at the end of the
turn. The weights, tokenizer and chat template are unchanged.
Independent benchmark
The authors' prompts, sampling and graders (scores + scripts), vLLM bf16, seed 0. MATH-500: 500 Γ 4
samples. GSM8K: 1,319 Γ 2. IFEval: 541 Γ 2, strict prompt-level, official checkers, answer after </think>.
Thinking on: temperature 0.6, top_p 0.95, top_k 20, presence_penalty 1.5, 32k tokens. Thinking off: temperature 0.7,
top_p 0.8, 8k tokens. In parentheses: the share of answers that hit the token limit.
| MATH-500 | GSM8K | IFEval | |
|---|---|---|---|
| Base, thinking on | 7.4 (93%) | 13.0 (89%) | 19.2 (76%) |
| Edited, thinking on | 50.2 (32%) | 67.6 (7%) | 62.1 (2%) |
| Authors, thinking on | 7.9 β 48.1 | 13.8 β 67.1 | 21.0 β 62.3 |
| Base, thinking off | 45.8 (32%) | 57.1 (4%) | 52.9 (0.4%) |
| Edited, thinking off | 43.6 (31%) | 55.7 (4%) | 51.2 (0.1%) |
Edited minus base, paired by problem, 95% CI:
| MATH-500 | GSM8K | IFEval | |
|---|---|---|---|
| Both thinking on (the paper's claim) | +42.8 [39.3, 46.3] | +54.7 [52.5, 56.9] | +42.9 [39.1, 46.6] |
| Edited thinking on vs. base thinking off (the base model's best setting) | +4.3 [1.9, 6.8] | +10.5 [8.3, 12.7] | +9.2 [5.2, 13.2] |
| Both thinking off | β2.2 [β4.3, β0.1] | β1.4 [β3.4, +0.6] | β1.7 [β4.2, +0.9] |
All three of the authors' thinking-on results reproduce within about 2 points. The edited model with thinking on also beats the base model's best setting (thinking off) on every benchmark. With thinking off, the edit costs about 1.5β2 points, which is significant only on MATH-500.
β οΈ This removes a failure mode; it doesn't add capability. Almost all of the gain comes from answers that no longer loop to the token limit.
TODO
- Independent MATH-500 benchmark
- GSM8K / IFEval reproduction
- ONNX / Transformers.js build
- GGUF (BF16) for llama.cpp / LM Studio / Ollama
- In-browser demo
Notes
- The authors' grader (
mathqa.py) imports an internal module (mcqa) that isn't in their release. It's only used for loop diagnostics, so the benchmark uses a one-function stand-in and leaves their file untouched. evaluate.pyalso needs their internal package, so I wrote a small MATH-500 script that copies its prompt, sampling and vLLM settings.- Rebuild it yourself with
exp8_math/code/apply_edit.py(base revision2fc06364). The script checks every tensor's hash.
License
The base model is Apache 2.0 Β© Qwen (LICENSE). This is a modified version: 2 tensors changed. The edit is CC BY 4.0, by the authors above.
@misc{takehi2026weightspace,
title = {Sparks of Weight-Space Programming: LLMs can natively read \& write neural network weights},
author = {Takehi, Rikiya and Teoh, Jayden and Zhang, Alex and Khattab, Omar},
year = {2026},
url = {https://rikiyat.github.io/blog/weight-space-programming/}
}
- Downloads last month
- 975