Text Generation
GGUF
English
rocmfp4
quantized
amd
rocm
strix-halo
qwen3
agent
repository-exploration
conversational
Instructions to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Hal0ai/FastContext-Hal0-4B-ROCmFP4", filename="FastContext-4B-ROCmFP4-STRIX_LEAN.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 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 Hal0ai/FastContext-Hal0-4B-ROCmFP4 # Run inference directly in the terminal: llama cli -hf Hal0ai/FastContext-Hal0-4B-ROCmFP4
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Hal0ai/FastContext-Hal0-4B-ROCmFP4 # Run inference directly in the terminal: llama cli -hf Hal0ai/FastContext-Hal0-4B-ROCmFP4
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 Hal0ai/FastContext-Hal0-4B-ROCmFP4 # Run inference directly in the terminal: ./llama-cli -hf Hal0ai/FastContext-Hal0-4B-ROCmFP4
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 Hal0ai/FastContext-Hal0-4B-ROCmFP4 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Hal0ai/FastContext-Hal0-4B-ROCmFP4
Use Docker
docker model run hf.co/Hal0ai/FastContext-Hal0-4B-ROCmFP4
- LM Studio
- Jan
- vLLM
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Hal0ai/FastContext-Hal0-4B-ROCmFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hal0ai/FastContext-Hal0-4B-ROCmFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Hal0ai/FastContext-Hal0-4B-ROCmFP4
- Ollama
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with Ollama:
ollama run hf.co/Hal0ai/FastContext-Hal0-4B-ROCmFP4
- Unsloth Studio
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 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 Hal0ai/FastContext-Hal0-4B-ROCmFP4 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 Hal0ai/FastContext-Hal0-4B-ROCmFP4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Hal0ai/FastContext-Hal0-4B-ROCmFP4 to start chatting
- Pi
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Hal0ai/FastContext-Hal0-4B-ROCmFP4
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Hal0ai/FastContext-Hal0-4B-ROCmFP4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Hal0ai/FastContext-Hal0-4B-ROCmFP4
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 Hal0ai/FastContext-Hal0-4B-ROCmFP4
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Hal0ai/FastContext-Hal0-4B-ROCmFP4
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 "Hal0ai/FastContext-Hal0-4B-ROCmFP4" \ --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"
- Docker Model Runner
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with Docker Model Runner:
docker model run hf.co/Hal0ai/FastContext-Hal0-4B-ROCmFP4
- Lemonade
How to use Hal0ai/FastContext-Hal0-4B-ROCmFP4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Hal0ai/FastContext-Hal0-4B-ROCmFP4
Run and chat with the model
lemonade run user.FastContext-Hal0-4B-ROCmFP4-{{QUANT_TAG}}List all available models
lemonade list
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
base_model: microsoft/FastContext-1.0-4B-SFT
|
| 4 |
+
base_model_relation: quantized
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
library_name: gguf
|
| 7 |
+
tags:
|
| 8 |
+
- gguf
|
| 9 |
+
- rocmfp4
|
| 10 |
+
- quantized
|
| 11 |
+
- amd
|
| 12 |
+
- rocm
|
| 13 |
+
- strix-halo
|
| 14 |
+
- qwen3
|
| 15 |
+
- agent
|
| 16 |
+
- repository-exploration
|
| 17 |
+
language:
|
| 18 |
+
- en
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
<p align="center">
|
| 22 |
+
<img src="hal0-banner.png" alt="hal0" width="420"/>
|
| 23 |
+
</p>
|
| 24 |
+
|
| 25 |
+
# FastContext-Hal0-4B โ ROCmFP4 (STRIX_LEAN)
|
| 26 |
+
|
| 27 |
+
A 4-bit **ROCmFP4** quantization of [`microsoft/FastContext-1.0-4B-SFT`](https://huggingface.co/microsoft/FastContext-1.0-4B-SFT),
|
| 28 |
+
a lightweight repository-exploration subagent (Qwen3-4B backbone) for LLM coding agents.
|
| 29 |
+
|
| 30 |
+
Quantized and validated on **AMD Strix Halo** (Ryzen AI MAX+ 395 / Radeon 8060S, `gfx1151`)
|
| 31 |
+
using [`hal0ai/amd-strix-halo-toolboxes`](https://github.com/hal0ai) ๐ ๏ธ.
|
| 32 |
+
|
| 33 |
+
> ### โ ๏ธ Read this first โ special runtime required
|
| 34 |
+
> This file uses the experimental **`Q4_0_ROCMFP4`** GGUF tensor format. It is **NOT** loadable by
|
| 35 |
+
> stock `llama.cpp`, Ollama, LM Studio, or any standard GGUF runtime. It runs **only** in the
|
| 36 |
+
> [`charlie12345/rocmfp4-llama`](https://github.com/charlie12345/rocmfp4-llama) fork.
|
| 37 |
+
> ROCmFP4 is a custom Codebook10 / finite-UE4M3 layout โ it is **not** MXFP4 or NVFP4.
|
| 38 |
+
|
| 39 |
+
## What's in this repo
|
| 40 |
+
|
| 41 |
+
| File | Size | Format | BPW |
|
| 42 |
+
|---|---:|---|---:|
|
| 43 |
+
| `FastContext-4B-ROCmFP4-STRIX_LEAN.gguf` | 2.05 GiB | `Q4_0_ROCMFP4_STRIX_LEAN` | 4.38 |
|
| 44 |
+
|
| 45 |
+
`STRIX_LEAN` is a tensor-aware preset: norms stay `f32`, sensitive tensors keep higher precision,
|
| 46 |
+
and the bulk of the weights use the dual/fast ROCmFP4 layouts.
|
| 47 |
+
|
| 48 |
+
## Why ROCmFP4 here
|
| 49 |
+
|
| 50 |
+
On Strix Halo, token generation is memory-bandwidth-bound, so 4-bit weights decode much faster than
|
| 51 |
+
BF16 while keeping quality intact for tool-calling.
|
| 52 |
+
|
| 53 |
+
### Performance (`llama-bench`, ROCm0, FlashAttention on, Radeon 8060S)
|
| 54 |
+
|
| 55 |
+
| Metric | BF16 source | **ROCmFP4 STRIX_LEAN** | ฮ |
|
| 56 |
+
|---|---:|---:|---|
|
| 57 |
+
| Size | 7.49 GiB | **2.05 GiB** | **3.65ร smaller** |
|
| 58 |
+
| Prefill `pp512` | 2388 t/s | 2244 t/s | ~same (compute-bound) |
|
| 59 |
+
| Decode `tg128` | 25.6 t/s | **73.7 t/s** | **2.88ร faster** |
|
| 60 |
+
|
| 61 |
+
### Tool-calling quality (`server-test-function-call.py`, 5 multi-turn cases, greedy `temp 0`)
|
| 62 |
+
|
| 63 |
+
| | BF16 source | ROCmFP4 STRIX_LEAN |
|
| 64 |
+
|---|---:|---:|
|
| 65 |
+
| Cases passed | 2/5 | 4/5 |
|
| 66 |
+
|
| 67 |
+
In every case **both** models selected and ordered the correct tools โ the only failures were
|
| 68 |
+
"no final summary produced" after correct tool use, a stopping quirk shared by the BF16 source
|
| 69 |
+
(not a quantization artifact). **Takeaway: FP4 introduced no measurable tool-calling regression.**
|
| 70 |
+
A 5-case harness can't rank models finely, so read this as "quality preserved," not "FP4 > BF16."
|
| 71 |
+
|
| 72 |
+
## How to run
|
| 73 |
+
|
| 74 |
+
Build the fork for your AMD GPU (see its README), then:
|
| 75 |
+
|
| 76 |
+
```bash
|
| 77 |
+
HSA_OVERRIDE_GFX_VERSION=11.5.1 \
|
| 78 |
+
GGML_HIP_ENABLE_UNIFIED_MEMORY=1 \
|
| 79 |
+
./build-strix-rocmfp4/bin/llama-server \
|
| 80 |
+
-m FastContext-4B-ROCmFP4-STRIX_LEAN.gguf \
|
| 81 |
+
-dev ROCm0 -ngl 999 -c 262144 -fa on --jinja
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
For scripted/non-interactive generation use `llama-completion` (this fork's `llama-cli` is
|
| 85 |
+
interactive-only and rejects `-no-cnv`). FastContext supports up to **262K** context.
|
| 86 |
+
|
| 87 |
+
## How it was made
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
# 1. HF safetensors -> BF16 GGUF
|
| 91 |
+
python convert_hf_to_gguf.py ./FastContext-1.0-4B-SFT --outtype bf16 --outfile fc-bf16.gguf
|
| 92 |
+
# 2. BF16 -> ROCmFP4 (same fork binary the server uses)
|
| 93 |
+
llama-quantize fc-bf16.gguf FastContext-4B-ROCmFP4-STRIX_LEAN.gguf Q4_0_ROCMFP4_STRIX_LEAN
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
## License & attribution
|
| 97 |
+
|
| 98 |
+
- Weights derive from [`microsoft/FastContext-1.0-4B-SFT`](https://huggingface.co/microsoft/FastContext-1.0-4B-SFT) โ **MIT**.
|
| 99 |
+
- Backbone: [`Qwen/Qwen3-4B-Instruct-2507`](https://huggingface.co/Qwen/Qwen3-4B-Instruct-2507) โ Apache-2.0.
|
| 100 |
+
- Quantization format & tooling: [`charlie12345/rocmfp4-llama`](https://github.com/charlie12345/rocmfp4-llama).
|
| 101 |
+
|
| 102 |
+
This repository redistributes a quantized derivative under the terms of the upstream MIT license.
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
### About hal0ai
|
| 107 |
+
|
| 108 |
+
Built and benchmarked with **[hal0ai](https://github.com/hal0ai)** โ local-first AI agent
|
| 109 |
+
infrastructure tuned for **AMD Strix Halo**. The
|
| 110 |
+
[`amd-strix-halo-toolboxes`](https://github.com/hal0ai) ship ready-to-run ROCm + ROCmFP4
|
| 111 |
+
container images so you can quantize and serve large models on a single unified-memory APU.
|
| 112 |
+
If you're running agents on AMD silicon, come say hi. ๐
|