Instructions to use terelabs/flint-GGUF 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 terelabs/flint-GGUF 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 terelabs/flint-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf terelabs/flint-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf terelabs/flint-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf terelabs/flint-GGUF:Q4_K_M
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 terelabs/flint-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf terelabs/flint-GGUF:Q4_K_M
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 terelabs/flint-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf terelabs/flint-GGUF:Q4_K_M
Use Docker
docker model run hf.co/terelabs/flint-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use terelabs/flint-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "terelabs/flint-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "terelabs/flint-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/terelabs/flint-GGUF:Q4_K_M
- Ollama
How to use terelabs/flint-GGUF with Ollama:
ollama run hf.co/terelabs/flint-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use terelabs/flint-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf terelabs/flint-GGUF:Q4_K_M
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": "terelabs/flint-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use terelabs/flint-GGUF with Docker Model Runner:
docker model run hf.co/terelabs/flint-GGUF:Q4_K_M
- Lemonade
How to use terelabs/flint-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull terelabs/flint-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.flint-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use terelabs/flint-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf terelabs/flint-GGUF:Q4_K_M
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 terelabs/flint-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use terelabs/flint-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf terelabs/flint-GGUF:Q4_K_M
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 "terelabs/flint-GGUF:Q4_K_M" \ --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"
Flint GGUF (Tere Labs)
imatrix GGUF quantizations of RecursiveSI/flint, Recursive's 39.8B-A2.5B mixture-of-experts coding model, made by Tere Labs. This is an independent community quantization, not an official Recursive release.
Three files, one imatrix, and every number below was measured with the same method on the same machine against the original BF16 weights.
Files
| File | Bytes | GB | GiB | bpw | KLD mean vs BF16 | top-1 agreement |
|---|---|---|---|---|---|---|
flint-Q5_K_M.gguf |
28,976,821,344 | 28.98 | 26.99 | 5.83 | 0.369 | 87.3% |
flint-Q4_K_M.gguf |
25,017,398,368 | 25.02 | 23.30 | 5.03 | 0.440 | 85.8% |
flint-IQ4_XS.gguf |
22,242,866,272 | 22.24 | 20.72 | 4.47 | 0.473 | 85.3% |
imatrix.gguf |
450,750,144 | 0.45 |
Memory guide (file size plus KV cache): IQ4_XS fits a 24 GB GPU with a small context or partial offload; Q4_K_M and Q5_K_M are meant for 32 GB+ of VRAM or GPU+RAM split.
Running
Flint support in llama.cpp lives in PR #30928. A build from main without that PR will not load the model. These files were built and tested with that PR at commit 1b44e30.
llama-server -hf terelabs/flint-GGUF:Q4_K_M --jinja -c 32768
llama-cli -hf terelabs/flint-GGUF:IQ4_XS --jinja
Flint has no BOS token (add_bos_token: false); llama.cpp picks this up from the GGUF metadata.
Chat template that llama.cpp can parse
The chat template shipped in the original checkpoint contains a replace("\x00", "") filter. llama.cpp's Jinja engine does not understand the \x escape, so llama-server --jinja fails to load that template; without --jinja the server falls back to a generic chat format and Flint's tool-call syntax is lost.
The template embedded in these files has that one filter removed and nothing else changed. Rendering a dialogue with tools through it is byte-identical to HF transformers with the original template. The same template is also provided as chat_template_llamacpp.jinja if you want to pass it explicitly with --chat-template-file.
Verified on llama.cpp PR #30928 @ 1b44e30. If llama.cpp later learns \x escapes, this difference disappears.
Recipe
llama-quantize --imatrix imatrix.gguf with base types Q5_K_M / Q4_K_M / IQ4_XS and these overrides:
token_embdandoutput: Q8_0- all attention (
attn_q,attn_k,attn_v,attn_output): Q8_0 - dense FFN of the first layers (
ffn_gate,ffn_up,ffn_down): Q8_0 - shared expert (
*_shexp): Q8_0 - routed experts: the file's base type. This is almost all of the model's weight.
The trade-off is deliberate: everything that runs on every token is stored nearly lossless, and the routed experts carry the compression. Our Q4_K_M is 0.85 GB larger than the lmstudio Q4_K_M for this reason.
imatrix
About 890k tokens, ctx 512, 1732 chunks:
- ~300k tokens of tool-calling dialogues from NousResearch/hermes-function-calling-v1 (Apache-2.0), rendered through Flint's own chat template so the calibration sees exactly the tokens the model generates:
<tool_call>name<arg_key>…</arg_key><arg_value>…</arg_value></tool_call> - ~500k tokens of code from six permissive repositories at pinned commits: requests, flask, express, ripgrep, gin, nlohmann/json
- ~150k tokens of prose from wikitext
No overlap with the KLD evaluation text or with BFCL. Expert coverage: in some layers one expert out of 256 received no calibration data ("partial data 99.61%"); llama.cpp uses default values for it.
Checks before quantization
- Tokenizer: llama.cpp matches the HF tokenizer on code (3k and 60k characters, 13,359 tokens) and on a dialogue with tools.
- Weights: the BF16 converted from the final release is byte-identical to unsloth's BF16 (built from
flint-preview) on every tensor checked. Comparisons with unsloth files below are therefore comparisons of quantization, not of weights. - BOS forced off for every file in every measurement.
Comparison with other Flint GGUFs
All rows measured by us against the same BF16 reference. Lower KLD is better; higher agreement is better.
| File | GB | KLD mean | KLD median | KLD p99 | top-1 | same tool call as BF16 | BFCL correct |
|---|---|---|---|---|---|---|---|
| BF16 (reference) | 79.63 | 0 | 0 | 0 | 100% | 100% | 79.7% |
| ours Q5_K_M | 28.98 | 0.369 | 0.0072 | 7.18 | 87.3% | 78.7% | 81.0% |
| official int4 Q4_1 (QAT) | 25.99 | 0.675 | 0.0342 | 9.81 | 80.4% | 77.0% | 81.0% |
| unsloth UD-Q4_K_XL | 25.05 | 0.389 | 0.0098 | 7.24 | 86.5% | 79.7% | 80.0% |
| ours Q4_K_M | 25.02 | 0.440 | 0.0116 | 8.11 | 85.8% | 80.0% | 78.3% |
| lmstudio Q4_K_M | 24.17 | 0.668 | 0.0273 | 10.39 | 82.1% | 76.0% | 80.3% |
| ours IQ4_XS | 22.24 | 0.473 | 0.0134 | 8.62 | 85.3% | 78.3% | 78.7% |
Measurement error: KLD mean ±0.007–0.010; top-1 about ±0.2 pp; tool-call and BFCL ±4.5 pp (95% CI, 300 tasks).
What the table supports:
- IQ4_XS is the smallest published Flint GGUF (22.24 GB): 1.9 GB smaller than lmstudio Q4_K_M with 29% lower KLD (0.473 vs 0.668) and higher top-1 (85.3% vs 82.1%); 3.75 GB smaller than the official int4.
- Q4_K_M is 1.5x closer to BF16 than the lmstudio Q4_K_M of the same name, for 3.5% more size (KLD 0.440 vs 0.668).
- Q4_K_M is at the top of the 4-bit group on reproducing BF16's tool calls: 80.0% vs 79.7% (unsloth), 77.0% (official) and 76.0% (lmstudio). The gap to unsloth is within noise. unsloth UD-Q4_K_XL and our Q4_K_M are the two strongest 4-bit files: ours leads on tool-call agreement, theirs on KLD.
- Q5_K_M is the closest file to BF16 of everything measured: KLD 0.369, median 0.0072, top-1 87.3%, at 36% of the BF16 size. On the tool-call bench it lands at 78.7% same-call agreement and 81.0% BFCL correct, both within the ±4.5 pp noise of the 4-bit group: the extra bits show up in the logits, not in this 300-task bench.
- All our files are closer to the original BF16 than the official int4. The official file comes from quantization-aware training, so its distance from BF16 is by design; this is a statement about closeness to BF16, not about which is better.
- BFCL accuracy is statistically indistinguishable from BF16 for every file, including the other publishers' files: everything lands in 78–81% and no pairwise difference is significant (exact McNemar, p 0.29–1.0; all 1.0 after Bonferroni). 73 of the 300 tasks are unstable under greedy decoding for BF16 itself.
- Only these files work with
llama-server --jinjaout of the box. The official, unsloth and lmstudio GGUFs embed the original template with the\x00filter described above.
Method
KLD and top-1:
llama-perplexity --kl-divergenceagainst BF16 logits- text: code from four other permissive repositories (httpx, fd, cobra, axios), disjoint from the calibration set
- ctx 2048, 40 chunks; BF16 perplexity on this text is 7.737
Tool calling:
- 300 BFCL v3 tasks (simple, multiple, parallel, parallel_multiple, live_simple, live_multiple, irrelevance, live_irrelevance)
- prompts rendered with Flint's official chat template; greedy, up to 4096 tokens, one server slot, BOS off. A repeat BF16 run matched 100%.
- "same tool call": function name and all arguments match BF16 (call order ignored)
- "BFCL correct": a simplified BFCL AST checker against the reference answers
Per-file raw numbers (31 columns, including per-category BFCL accuracy) are in comparison.csv in this repository.
Changes from the original (Apache-2.0, section 4b)
These files are derivatives of RecursiveSI/flint (Apache-2.0, copyright Recursive). Changes made by Tere Labs:
- converted from safetensors to GGUF;
- weights quantized with llama.cpp using the imatrix and recipe above;
- embedded chat template modified to remove the
replace("\x00", "")filter that llama.cpp's Jinja engine cannot parse.
The license text is in LICENSE. "Flint" and "Recursive" are names of Recursive and its model; this repository is not affiliated with or endorsed by Recursive.
- Downloads last month
- -
Model tree for terelabs/flint-GGUF
Base model
RecursiveSI/flint