Instructions to use 42ailab/AIWriter-V1-4B-Typeset-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use 42ailab/AIWriter-V1-4B-Typeset-Preview 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 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0 # Run inference directly in the terminal: llama cli -hf 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0 # Run inference directly in the terminal: llama cli -hf 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
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 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
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 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
Use Docker
docker model run hf.co/42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
- LM Studio
- Jan
- vLLM
How to use 42ailab/AIWriter-V1-4B-Typeset-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "42ailab/AIWriter-V1-4B-Typeset-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "42ailab/AIWriter-V1-4B-Typeset-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
- Ollama
How to use 42ailab/AIWriter-V1-4B-Typeset-Preview with Ollama:
ollama run hf.co/42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
- Unsloth Desktop
- Pi
How to use 42ailab/AIWriter-V1-4B-Typeset-Preview with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
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": "42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use 42ailab/AIWriter-V1-4B-Typeset-Preview with Docker Model Runner:
docker model run hf.co/42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
- Lemonade
How to use 42ailab/AIWriter-V1-4B-Typeset-Preview with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
Run and chat with the model
lemonade run user.AIWriter-V1-4B-Typeset-Preview-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use 42ailab/AIWriter-V1-4B-Typeset-Preview with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
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 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use 42ailab/AIWriter-V1-4B-Typeset-Preview with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0
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 "42ailab/AIWriter-V1-4B-Typeset-Preview:Q8_0" \ --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"
AIWriter Typst Typesetting Model ยท V1 Preview
โ ๏ธ Preview release. V1 is not finalized. The stable release will be published at
42ailab/AIWriter-V1-4B-Typesetafter the AIWriter launch event. This repository will be kept, not deleted (for reproducibility) and marked as superseded at that time. "V1" denotes the model generation, not a finalized version.
1. Introduction
AIWriter Typst Typesetting Model is trained in-house by 42ailab to turn typesetting intent into compilable Typst source, covering both books and academic papers.
Typesetting has one property that sets it apart from most generation tasks:
Typeset output that does not compile is worth nothing, however elegant its structure.
So we optimize for render rate โ whether the output actually compiles โ as the primary metric, rather than layout score alone.
Key Features
- 94% render rate โ the highest of everything we ran on this benchmark. Read it with the scope note below: the external models were not all called under one protocol, so treat this as "the best render rate we measured", not a leaderboard win;
- A 4B model outscoring a 397B one: 76.12 overall, 18.75 points higher than the 397B-parameter baseline;
- From 0% to 94%: the same base model, untrained, compiles nothing at all;
- Chinese typesetting: books (first-line indent, title marks, emphasis dots, mixed CJK/Latin) and academic work (numbered equations, booktabs, figure references, bibliographies);
- Fully local: 4B parameters, runs on an ordinary laptop, works offline โ your manuscript never leaves your machine;
- Open weights: free for academic research and personal use.
2. Model Summary
| Base model | Qwen3-4B (Apache-2.0, Qwen Team) |
| Parameters | 4B |
| Context length | 16,384 |
| Recommended output | 900 tokens |
| Output format | Typst source |
| Released format | GGUF Q8_0 (4.28 GB) |
| License | AIWriter Model License 1.0 (free for academic & personal use; commercial use requires a licence) |
3. Evaluation
Results on the public StructEval-Typst benchmark. render is the compile success
rate โ the first hurdle any typesetting output has to clear:
Sorted by overall score. This lists the models we ran, not a complete leaderboard:
| Model | Size | Overall | render โ |
|---|---|---|---|
| Kimi-k2.7-code | โ | 78.99 | 92% |
| This model | 4B | 76.12 | 94% |
| DeepSeek-V4.1-Flash | โ | 75.57 | 84% |
| GLM-5.2 | โ | 64.55 | 72% |
| qwen3.8-flash | โ | 60.88 | 68% |
| Qwen3.5-397B | 397B | 57.37 | 62% |
| Base model (untrained) | 4B | 9.94 | 0% |
Scope: layout scoring uses an open multimodal model as an approximation (the official protocol uses GPT-4o-class judges); render and keyword scoring follow the official logic exactly. Kimi-k2.7-code, GLM-5.2, Qwen3.5-397B and the untrained base model come from a 2026-07 run under the same judge; DeepSeek-V4.1-Flash and qwen3.8-flash were measured in 2026-09 โ the two batches of external models were not called under identical protocols, so compare with that in mind. A held-out test set is reserved for the closed evaluation of the stable release.
The full evaluation design, training recipe and ablations will appear in the technical report and the accompanying papers.
4. Download & Deployment
This model is packaged for 42model, our local inference engine โ the recommended way to get it:
42model desktop
Open Model Library โ Writing and download
AIWriter Typst Typesetting Model ยท V1 Preview (Q8_0, 4.28 GB). That is all you need to do
here โ AIWriter picks the model up on its own (next section).
Inside AIWriter
Once installed, open AIWriter โ the desktop app discovers the local engine automatically; no endpoint or key to configure. AIWriter compiles the result before showing it to you, so output that fails to build never reaches your desk. Everything runs on your machine; your manuscript never leaves it.
Files
| File | Build | Size |
|---|---|---|
AIWriter-V1-4B-Typeset-Q8_0.gguf |
quality | 4.28 GB |
SHA-256 checksums are listed on the Files page.
5. Limitations
- Context 16,384 with 900-token output; a full book must be segmented by the application;
- Compiling is not the same as being faithful โ Typst source that builds may still have dropped or altered text, so the application must verify content fidelity;
- Training targets Simplified Chinese books and academic papers; other languages and layout traditions have not been systematically evaluated;
- It does not write content โ only typesetting.
6. License & Attribution
- This model is released under the AIWriter Model License 1.0: free for academic research, teaching, evaluation and personal use (including fine-tuning and derivatives, with attribution); commercial use requires prior written permission (contact@42ailab.com).
- Intellectual property: the training methodology, data construction and evaluation design remain the property of 42ailab. This licence grants no patent rights.
- Base model: Qwen3-4B, ยฉ Qwen Team, Apache-2.0. Rights in the base model are unaffected by this licence โ anyone may obtain and use Qwen3-4B itself under Apache-2.0; this licence applies only to the part we trained on top of it.
- Evaluation uses StructEval (Apache-2.0) together with our own Chinese typesetting benchmark.
- Training data comes from 42ailab's own corpus, synthetic data and public datasets.
7. Citation
The technical report and accompanying papers are in preparation; DOI and arXiv links will be added here on publication. In the meantime:
@misc{aiwriter2026typeset,
title = {AIWriter Typst Typesetting Model V1 (AIWriter-V1-4B-Typeset)},
author = {Yang, Zhiping and {42ailab}},
year = {2026},
howpublished = {\url{https://huggingface.co/42ailab/AIWriter-V1-4B-Typeset-Preview}},
organization = {42ailab},
note = {Preview weights; technical report forthcoming, DOI and arXiv to be added here.
Base model Qwen3-4B (Apache-2.0). Contact: contact@42ailab.com}
}
Contact: contact@42ailab.com
About Us
42ailab โ an AI research lab exploring the boundaries of intelligence. Grounded in cognitive science, we work towards a deep integration of AI and human intelligence โ truly understanding and augmenting intelligence, carbon-based and silicon-based alike.
42model โ a high-performance local AI inference engine from 42ailab. Translation, transcription, recognition, chat and coding run free and private on your own machine; you can also fine-tune your own model with cloud compute and bring the weights back home.
- Downloads last month
- 110
8-bit