A dependency-free C inference engine for Liquid AI's LFM2 / LFM2.5 / LFM3 models and Qwen3.6.
Terminal chat, an OpenAI-compatible server, a web agent, a terminal agent and a voice, all in one executable.
Website & setup guide · Quick start · Screenshots · Results · Terminal agent · Speech · Xbox One · MCP · Roadmap
| About 1.9× faster than llama.cpp | 17–22 tok/s against 11 tok/s with CUDA, on the same laptop and model (head-to-head) |
| Runs a 13.5 GB model on 16 GB of RAM | experts stream from disk, the hot ones live in a 4 GB GPU |
| Agents included | Pandora in the browser, and a terminal agent that runs commands, fixes code and checks its own work |
| Hears and speaks | with LFM3-Audio-2B: transcription and translation in 18 languages, streamed speech (WAV, PCM, MP3) and voice conversations on the /talk page (speech) |
| Runs on an Xbox One | an OpenAI-compatible server for your home network, with LFM3-1.7B on the console's GPU: 29.5 tok/s generation, ~140 tok/s prompt; with LFM3-Audio-2B you talk to it through the controller's headset (Xbox One) |
Pithos is an inference engine written from scratch in C11 with no dependencies: no external
libraries at build time, only the operating system API (Win32 or POSIX). It runs GGUF models of
Liquid AI's LFM2 / LFM2-MoE / LFM3 architectures and is tuned for LFM2.5-24B-A2B-Q4_K_M.gguf
(24 billion parameters, about 2 billion active per token) on an ordinary laptop. Two smaller models
are validated too: LFM2.5-8B-A1B, a mixture of experts that fits
in 8 GB of RAM (about 22 tokens per second on the CPU alone), and the small
LFM3-1.7B: about 80 tokens per second with the GPU, 20 on the CPU alone.
LFM3-Audio-2B (experimental) adds speech: it
transcribes, translates, speaks and holds voice conversations.
Pithos is the engine and the server (in the myth, the pithos is Pandora's jar: it holds the model). Pandora is the agent in the web interface.
- CPU inference with AVX2 / AVX / NEON integer kernels that read the quantized weights in place.
- Optional OpenCL GPU acceleration: hot experts and all dense layers in VRAM, with the remaining experts computed on the CPU in parallel. On dedicated GPUs the prompt runs there too (LFM2.5-8B: almost 4× the CPU alone).
- Optional Direct3D 12 GPU acceleration (
--gpu d3d12, Windows and Xbox): for dense models such as LFM3, the whole forward pass, prompt included, runs on the GPU. - Optional Vulkan GPU acceleration (
--gpu vulkan, Windows and Linux; experimental): the same kernels and the same whole forward pass as Direct3D 12, on any GPU with a Vulkan 1.1 driver. - One option chooses the GPU backend,
--gpu; by default (auto) Pithos picks the fastest one measured for the model (Choosing the GPU). - An Xbox One app: the server runs on a console in Developer Mode, with a status and chat screen on the TV, and with LFM3-Audio-2B a full-screen voice assistant used through the controller's headset.
- Works with models larger than the free RAM (asynchronous read-ahead, expert prediction).
- OpenAI-compatible HTTP server with prompt reuse across turns, also after a restart.
- Speech with LFM3-Audio-2B:
/v1/audio/transcriptions,/v1/audio/translationsand/v1/audio/speech(WAV, PCM or MP3, streamed), spoken answers, dictation and a voice mode in Pandora, and the/talkpage for voice conversations. - Reasoning levels: high, medium, low or off, from the command line, the API or a selector in Pandora.
- Pandora, a single-file web chat with an agent mode: web search, files, calculator and any MCP server.
- A terminal agent that works on tasks with shell commands, background processes, files and the web, on Windows and Linux, in a safe mode (you approve every action) or an autonomous one.
Pandora, the web agent, answers with real tools. Here it runs two git commands through the
shell tools (pithos --server --shell) and summarizes them. Each card shows the command, the exit
code, the run time and the output.
The terminal agent in autonomous mode (pithos --auto). It is asked to make failing tests
pass. It reads the code, finds the bug, fixes it with edit_file, runs the tests and reads the
file back. On Windows PowerShell 5.1 the && it wrote was rewritten automatically.
Both are real sessions with LFM2.5-24B-A2B on the reference laptop (i5-10500H, GTX 1650 4 GB).
Pithos.X Server on an Xbox One S: the TV screen while the server runs. More in Xbox One.
Prebuilt binaries for Windows x64, Linux x64 and Linux ARM64 (experimental) are on the
Releases page: extract the archive, put the model
in a models folder next to the program and skip the build step below. The Linux x64 binary needs
glibc 2.34 or newer (Ubuntu 22.04, Debian 12, RHEL / Rocky 9 and later). The ARM64 archive has two programs:
pithos for cores with dot product (Raspberry Pi 5, RK3566 / RK3588) and pithos-armv8 for older
ones (Raspberry Pi 3 / 4). Otherwise build from source:
- Get the model (see Downloading the model below).
On Linux,
bash build.sh --download-modelcan handle both the build and this download (--download-model=lfm2.5-8bor--download-model=lfm3-1.7bfor the smaller models,--download-model=lfm3-audio-2bfor the speech model,--list-modelsfor the choices). - Build. On Windows run
build.cmd; on Linux runbash build.sh; on macOS runmake(see Building). You can compile before downloading the model. - Run.
server.cmd server + web chat in the browser (http://127.0.0.1:8080)
build\pithos.exe interactive chat in the terminal
build\pithos.exe -p "Hello, who are you?" single answer
build\pithos.exe --server OpenAI-compatible API + web interface
build\pithos.exe --agent terminal agent in the current folder (safe mode)
build\pithos.exe --bench prompt and generation benchmark
On Linux / macOS the binary is build/pithos, with the same options. For the console, see
Xbox One: the app is built on a Windows PC and installed over the network.
Three models are validated, and Qwen3.6 is experimental. Choose by the memory of your computer:
| Model | Download | RAM | Best for |
|---|---|---|---|
| LFM2.5-24B-A2B (the reference, MoE) | 13.5 GiB | 16 GB | the deepest answers; it also runs when the model does not fit in RAM, from disk |
| LFM2.5-8B-A1B (MoE) | 4.8 GiB | 8 GB | a larger model on the CPU: it fits in RAM and generates as fast as LFM3-1.7B there |
| LFM3-1.7B (dense) | 1.0 GiB | 4 GB | modest hardware, the fastest with a GPU (the whole model in VRAM), the Xbox One |
| Qwen3.6-35B-A3B (MoE, experimental) | 19.1 GiB | 16 GB | the largest; it runs from disk when it does not fit in RAM, best with a GPU |
For speech, LFM3-Audio-2B (experimental, 1.2 GiB with its audio projector, 4 GB of RAM) transcribes, translates, speaks and holds voice conversations.
Pithos uses by default the file LFM2.5-24B-A2B-Q4_K_M.gguf from Liquid AI's public repository
LiquidAI/LFM2.5-24B-A2B-GGUF. No account
is needed.
| Size | 14,526,258,464 bytes (13.5 GiB): keep about 15 GB free on the disk |
| SHA-256 | d3334405b96228eb9908cdebb5c6194908f2da64282bda852afc3a3910c64e7d |
| Direct link | https://huggingface.co/LiquidAI/LFM2.5-24B-A2B-GGUF/resolve/main/LFM2.5-24B-A2B-Q4_K_M.gguf |
| License | LFM Open License v1.0 (see the model card) |
Where to put it. Pithos looks for models/LFM2.5-24B-A2B-Q4_K_M.gguf in the current folder, then
in ../models and ../../models. The simplest choice is a models folder inside the Pithos folder,
which .gitignore already excludes. Any other location works with -m PATH, and the terminal agent,
which runs in your project folders, usually needs it.
The commands below run from the Pithos folder. All of them resume an interrupted download when you run them again.
Windows (PowerShell). curl.exe ships with Windows 10 and 11. Write curl.exe, not curl,
which in Windows PowerShell 5.1 is an alias of a different command.
New-Item -ItemType Directory -Force models | Out-Null
curl.exe -L -C - -o models\LFM2.5-24B-A2B-Q4_K_M.gguf https://huggingface.co/LiquidAI/LFM2.5-24B-A2B-GGUF/resolve/main/LFM2.5-24B-A2B-Q4_K_M.gguf
Get-FileHash models\LFM2.5-24B-A2B-Q4_K_M.gguf -Algorithm SHA256 # compare with the SHA-256 aboveLinux / macOS.
mkdir -p models
curl -L -C - -o models/LFM2.5-24B-A2B-Q4_K_M.gguf https://huggingface.co/LiquidAI/LFM2.5-24B-A2B-GGUF/resolve/main/LFM2.5-24B-A2B-Q4_K_M.gguf
# or: wget -c -O models/LFM2.5-24B-A2B-Q4_K_M.gguf <the same URL>
sha256sum models/LFM2.5-24B-A2B-Q4_K_M.gguf # macOS: shasum -a 256 models/LFM2.5-24B-A2B-Q4_K_M.ggufWith the Hugging Face CLI (any system). If Python is installed, this is the most robust option on slow or unstable connections.
pip install -U huggingface_hub
hf download LiquidAI/LFM2.5-24B-A2B-GGUF LFM2.5-24B-A2B-Q4_K_M.gguf --local-dir models
With a browser. Open the direct link above and save the file into the models folder.
To check that the file is found and complete, run build\pithos.exe -p "Hello" (Linux:
build/pithos -p "Hello"). The first lines report the model (model: lfm2moe | 40 layers ...).
Pithos also rejects a truncated file and names the tensor that is missing.
LiquidAI/LFM2.5-8B-A1B is a mixture of experts like
the reference model, with the same architecture (lfm2moe) and chat format: 8.3 billion parameters,
1.5 billion active per token, 24 layers (6 attention, 18 convolution) and 4 of 32 experts per token.
The file fits in the RAM of an 8 GB computer (the process uses about 4 GB), so nothing is read from
disk while it runs, and on the CPU alone it generates about as fast as LFM3-1.7B. Liquid AI recommends
it for instructions, tool use and multilingual assistants rather than heavy programming. Like the
24B model, it reasons before every answer (reasoning levels shorten it).
LFM2.5-8B-A1B on the reference laptop (--bench) |
Prompt | Generation |
|---|---|---|
CPU only (--cpu) |
71–73 tok/s | 22.5 tok/s |
| OpenCL (default here): 55% of the experts and the dense layers in VRAM, prompt included | 250–280 tok/s | 50–56 tok/s |
OpenCL, with prompt matmuls on Vulkan (--gpu opencl+vulkan) |
157 tok/s | 45–54 tok/s |
Vulkan (--gpu vulkan): dense matmuls only, the experts on the CPU |
79 tok/s | 24 tok/s |
Intel UHD Graphics (--gpu vulkan --gpu-device N) |
63 tok/s | 7.7 tok/s |
llama.cpp b12179 (Vulkan build) on the same laptop: 59 / 17 tok/s on the CPU, 95 / 40 with the
GTX 1650 and its best setting tried (-ngl 99 --n-cpu-moe 10).
build\pithos.exe -m models\LFM2.5-8B-A1B-Q4_K_M.gguf --server --open
| File | LFM2.5-8B-A1B-Q4_K_M.gguf from LiquidAI/LFM2.5-8B-A1B-GGUF |
| Size | 5,155,564,768 bytes (4.8 GiB): keep about 6 GB free on the disk |
| SHA-256 | 4923ec14f06b968b74d663e5949867d2d9c3bf13a20b8be1a9f9af39989b2bb0 |
| Direct link | https://huggingface.co/LiquidAI/LFM2.5-8B-A1B-GGUF/resolve/main/LFM2.5-8B-A1B-Q4_K_M.gguf |
| License | LFM Open License v1.0 (see the model card) |
Download it with the same commands as above (replace the file name and the URL), then pass it
with -m:
build/pithos -m models/LFM2.5-8B-A1B-Q4_K_M.gguf -i
build/pithos -m models/LFM2.5-8B-A1B-Q4_K_M.gguf --server --open
LiquidAI/LFM3-1.7B is a 1.7-billion-parameter model
that fits in 1.1 GB, with the same chat, server, Pandora and terminal agent. With a GPU every layer
lives in VRAM (1.2 GB with a 8k context) and decoding runs there: about 55 tokens per second on the
reference laptop (GTX 1650), against about 20 on the CPU alone. With OpenCL the prompt runs on the
GPU too, at about 240 tokens per second (on GPUs without an int8 dot product in hardware, such as
Intel's integrated ones, it stays on the CPU). Through Vulkan (Windows and Linux, experimental) or Direct3D 12
(Windows) the whole forward pass runs on the GPU, which is faster on both counts: about 330 tokens
per second of prompt, and 82 (Vulkan) or 69 (Direct3D 12) of generation. On a discrete NVIDIA GPU
Pithos uses Vulkan for this model by default; --gpu d3d12 or --gpu opencl choose the others.
This is also the model that runs on the Xbox One.
| LFM3-1.7B on the reference laptop | Prompt | Generation |
|---|---|---|
CPU only (--cpu) |
80–100 tok/s | 23 tok/s |
OpenCL (--gpu opencl) |
236–245 tok/s | 55 tok/s |
OpenCL, with prompt matmuls on Direct3D 12 (--gpu opencl+d3d12) |
180–190 tok/s | 56–60 tok/s |
Direct3D 12 (--gpu d3d12) |
330 tok/s | 69 tok/s |
Vulkan (default here, --gpu vulkan; experimental) |
328 tok/s | 82 tok/s |
build\pithos.exe -m models\LFM3-1.7B-Q4_K_M.gguf --server --open
| File | LFM3-1.7B-Q4_K_M.gguf from LiquidAI/LFM3-1.7B-GGUF |
| Size | 1,099,627,808 bytes (1.0 GiB) |
| SHA-256 | 3793e1e6e2266919d6e015287221b41100175a98eddaba92e111aed3b05c93c4 |
| Direct link | https://huggingface.co/LiquidAI/LFM3-1.7B-GGUF/resolve/main/LFM3-1.7B-Q4_K_M.gguf |
Download it with the same commands as above (replace the file name and the URL), then pass it
with -m:
build/pithos -m models/LFM3-1.7B-Q4_K_M.gguf -i
build/pithos -m models/LFM3-1.7B-Q4_K_M.gguf --server --open
LiquidAI/LFM3-Audio-2B is LFM3 with a speech
encoder and a speech decoder: it hears audio and speaks, in 18 languages, Italian included. Pithos
transcribes speech, answers questions about it or translates it, reads text aloud with a female or
male voice, and holds spoken conversations: Pandora's voice page at
/talk. Two files are
needed: the model, whose text part is the same architecture as LFM3-1.7B and runs on the same GPU
paths, and its audio projector (mmproj-...), which Pithos looks for next to the model (the
table below has their sizes and SHA-256). On Linux bash build.sh --download-model=lfm3-audio-2b
downloads and verifies both; elsewhere:
curl.exe -L -C - -o models\LFM3-Audio-2B-Q4_K_M.gguf https://huggingface.co/LiquidAI/LFM3-Audio-2B-GGUF/resolve/main/LFM3-Audio-2B-Q4_K_M.gguf
curl.exe -L -C - -o models\mmproj-LFM3-Audio-2B-Q4_K_M.gguf https://huggingface.co/LiquidAI/LFM3-Audio-2B-GGUF/resolve/main/mmproj-LFM3-Audio-2B-Q4_K_M.gguf
server.cmd -m models\LFM3-Audio-2B-Q4_K_M.gguf # Pandora with a microphone, /talk for voice conversations(curl instead of curl.exe and / in the paths on Linux and macOS.) Once the server runs, the
chat, the microphone and the voice page work in the browser; the command line:
build\pithos.exe -m models\LFM3-Audio-2B-Q4_K_M.gguf --audio speech.wav -s "Perform ASR in English."
build\pithos.exe -m models\LFM3-Audio-2B-Q4_K_M.gguf --audio speech.wav -s "Translate the following speech from English to Italian in text form."
build\pithos.exe -m models\LFM3-Audio-2B-Q4_K_M.gguf --audio speech.wav -p "What is happening in this recording?"
These are the system prompts of the model card: -s "Perform ASR." lets the model detect the
language; for questions the card suggests -s "Answer questions about the provided audio clip. Base every answer only on what can be heard.". Without a system prompt the model would rather
answer with speech, so in text answers its speech tokens are turned off, as the card does for
text-only answers (spoken answers are below). With -i the audio goes into the first message of the chat. The WAV
can be PCM (8, 16, 24 or 32-bit) or 32-bit float, at any sample rate and with any number of
channels: Pithos mixes it to mono and resamples it to 16 kHz.
With LFM3-Audio the server also serves a page for spoken conversations at
http://127.0.0.1:8080/talk (a button next to the context counter in Pandora opens it). Press
Start and talk: Pandora notices when you stop, answers aloud and listens again; speaking while it
talks interrupts it. In English the model answers in speech directly (its interleaved mode: text
and speech alternate as it generates), so the voice starts about a second after you stop. The
model's spoken chat is English only, so in other languages (Italian, French, German... chosen in
the page's settings, or the browser's language) Pandora transcribes what you say, writes a short
answer and speaks it a sentence at a time, about two seconds after you stop. The page needs the
microphone, which browsers give to localhost or https pages only.
Over the API, a spoken answer is a chat completion with "modalities": ["text", "audio"] and
"stream": true: the events carry the text as delta.content and the speech as
delta.audio.data (base64 of 16-bit 24 kHz mono PCM), as in OpenAI's audio chat. The model card
recommends the system prompt Respond with interleaved text and audio.
Speech output. --tts speaks a text into a WAV file (24 kHz):
build\pithos.exe -m models\LFM3-Audio-2B-Q4_K_M.gguf --tts "Buongiorno a tutti!" --tts-lang it --tts-voice male -o saluto.wav
Each step of the model gives a frame of 12 codes for 80 ms of speech (a small depth decoder picks
them in three passes), and the codec turns the frames into sound. On the reference laptop speech
comes out 2.7 times faster than real time with Vulkan (8.9 s of speech in 3.2 s), 1.2 times on the
CPU alone; OpenCL runs the text part of each step on the CPU here, as the speech decoder needs the
model's hidden state. The voices are those of the model card: female (default) and male.
| Model | Audio projector | |
|---|---|---|
| File | LFM3-Audio-2B-Q4_K_M.gguf |
mmproj-LFM3-Audio-2B-Q4_K_M.gguf |
| From | LiquidAI/LFM3-Audio-2B-GGUF | the same repository |
| Size | 1,099,626,016 bytes (1.0 GiB) | 172,418,048 bytes (164 MiB) |
| SHA-256 | 9a773289bd321ed879cd3a76545f6aca506e403851a45fb315420aee45625be2 |
1a3a895160aad17c1f52117a6ee4cea8e68988651ea5a33c5b990539e8eae81d |
The encoder runs on the CPU, about 30 times faster than real time on the reference laptop (54 s of speech in 1.7 s); the transcription itself then runs like any prompt, on the GPU if there is one. On test recordings in English and Italian (16, 22 and 44.1 kHz, up to a minute) the transcriptions are the same as llama.cpp's on the CPU, OpenCL and Vulkan, and what Pithos says is transcribed back word for word.
Qwen/Qwen3.6-35B-A3B is the largest model Pithos runs: 35 billion parameters, 256 experts of which 8 (plus a shared one) work on each token, about 3 billion active, and hybrid layers: 30 Gated DeltaNet layers and 10 of gated attention. It reasons before it answers and calls tools in XML, with the same chat, server, Pandora and terminal agent as the LFM models. The 19.1 GiB file does not fit in 16 GB of RAM: the experts stream from disk at first, and the ones in use stay in RAM.
With Vulkan (the default for this model on a discrete NVIDIA GPU) every layer runs on the GPU and the routed experts on the CPU; the most used experts also live in the VRAM that is left (1.1 GB on a 4 GB GPU, about 60% of each token's experts), and the GPU computes them while the CPU computes the others. Prompts of 32 tokens or more are cut in two halves, so that the GPU works on one while the CPU computes the experts of the other.
Qwen3.6-35B-A3B on the reference laptop (6-core CPU, 16 GB, 4 GB laptop GPU), --bench 512,128, warm |
Prompt | Generation |
|---|---|---|
| llama.cpp b12179, CPU only | 8.1 tok/s | 4.4 tok/s |
Pithos, CPU only (--gpu off) |
13.6 tok/s | 7.3 tok/s |
llama.cpp, Vulkan, every routed expert on the CPU (-ngl 99 -ncmoe 40) |
28.9 tok/s | 11.8 tok/s |
llama.cpp, Vulkan, the experts of 2 layers in VRAM (-ngl 99 -ncmoe 38) |
25.5 tok/s | 12.5 tok/s |
| Pithos, Vulkan (default here) | 82 tok/s | 22 tok/s (24–25 after a short prompt) |
The first run reads the experts from disk: 18 tok/s of prompt and 13 of generation with the GPU. The tool definitions of the agent and of the web UI (about 4,000 tokens) are read once, then reused from the prompt cache, even after a restart: a new session starts in seconds. Perplexity on the model license text: 1.451 (llama.cpp 1.467).
| File | Qwen3.6-35B-A3B-Q4_K_M.gguf from ggml-org/Qwen3.6-35B-A3B-GGUF |
| Size | 20,542,732,576 bytes (19.1 GiB): keep about 21 GB free on the disk |
| SHA-256 | f4ffe03c9139e6a905a5d346f77d9fabdd179367c3280dfd005d1e75ca5ed8c8 |
| Direct link | https://huggingface.co/ggml-org/Qwen3.6-35B-A3B-GGUF/resolve/main/Qwen3.6-35B-A3B-Q4_K_M.gguf |
| License | Apache 2.0 (see the model card) |
Download it with the same commands as above (replace the file name and the URL), then pass it
with -m:
build/pithos -m models/Qwen3.6-35B-A3B-Q4_K_M.gguf -i
build/pithos -m models/Qwen3.6-35B-A3B-Q4_K_M.gguf --server --open
Reference machine: i5-10500H (6 cores, AVX2), 16 GB DDR4-2933, GTX 1650 Max-Q 4 GB, NVMe SSD. The model (13.5 GB) does not fit in the free RAM (9–11 GB), so part of the weights is read from disk.
| Measure | llama.cpp b11798 CPU only | llama.cpp, 8 layers on GPU | Pithos CPU only | Pithos CPU+GPU |
|---|---|---|---|---|
| Prompt (pp, warm) | 6.0 tok/s | 12.5 tok/s | 15–33 tok/s | 36–45 tok/s |
| Generation, bench (tg, warm) | 6.6 tok/s | 11.3 tok/s | 11–13 tok/s | 12–14.6 tok/s |
| Real generation, 1000 tokens of varied text (v0.2, experts only on GPU) | — | 7–12 tok/s | 7.7 tok/s | 9.3 tok/s |
| Real generation, 600-token essay (dense layers on GPU) | — | — | — | 14–18 tok/s (11.4–14.1 with --no-gpu-dense) |
| Working set (process RAM) | — | 10.7 GB (peak) | ~9.5 GB | ~6.9 GB |
| Perplexity (model license text, 4×256 tokens) | 2.683 | — | 2.638 | 2.671 |
Since the prompt matmuls and the resident experts of the prompt run on the GPU (OpenCL, since
v0.6.0), the warm 512-token prompt (--bench) went from about 52 to about 100 tok/s on this
laptop; how much of the model is in RAM moves it a lot.
Numbers move with the memory state and the temperature. On this laptop the CPU and GPU share one heatsink, and under combined load the GPU throttles (88 °C measured). The generation runs with dense layers on the GPU used Cooler Boost (fans at maximum) and started with the GPU below 62 °C. A desktop with a dedicated GPU gains more in generation.
Same GGUF Q4_K_M, 8192 context, greedy sampling, prompt cache off, 6 threads, both running as
OpenAI servers. llama.cpp b11798 used -fit on, which picks the VRAM layout itself: all layers on
the GPU plus the experts of the first ~6 layers, the same scheme as Pithos. Engines alternated, the GPU was below 62 °C before
each measurement, Cooler Boost on, two rounds per engine (values r1 / r2). Script:
python tests/versus.py ROUNDS ENGINE.
| Measure | llama.cpp Vulkan | llama.cpp CUDA 12.4 | Pithos |
|---|---|---|---|
| Generation, 600 tokens | 10.2 / 10.7 tok/s | 11.2 / 11.3 tok/s | 17.5–21.9 tok/s |
| 1345-token prompt | 10.5 / 12.9 tok/s | 10.6 / 20.8 tok/s | 22.1–34.7 tok/s |
| Server start-up | 13–23 s | 33–57 s | 3–10 s |
| Peak process RAM | 10.2–10.9 GB | 10.6–10.9 GB | 10.8–11.0 GB |
In generation Pithos is about 1.9× llama.cpp CUDA. For both engines the limit is the experts
computed on the CPU, which Pithos runs in parallel with the GPU and with far fewer queued
commands. On the long prompt the advantage varies a lot between rounds, from 2.7× to almost even
with CUDA, because it depends on how much of the model is in RAM. Not tried: llama.cpp's
--load-mode none, which would load everything into RAM (the model does not fit in this
machine's free RAM).
Windows: build.cmd uses gcc when present (on the PATH, or from MSYS2 in C:\msys64\mingw64
or ucrt64), otherwise MSVC (Visual Studio or Build Tools, found automatically); build.cmd msvc
forces MSVC. build.cmd test (or build.cmd msvc test) also builds the tests. The Direct3D 12 backend is always included: d3d12.dll is loaded at runtime and the
shaders are precompiled in src/kernels_dx.h, so no extra SDK is needed. The same goes for the
Vulkan backend (vulkan-1.dll on Windows, libvulkan.so.1 on Linux, shaders in
src/kernels_vk.h). The Xbox app has its own build, described in Xbox One.
Download and extract the source ZIP, or clone the repository if Git is installed:
git clone https://github.com/benmaster82/Pithos.git
cd Pithos
bash build.shOn a fresh Ubuntu/Debian installation, install Git first with
sudo apt update && sudo apt install -y git, or use the ZIP download instead.
build.sh checks for GNU Make, a working C11 compiler, C development headers and
system libraries, and curl for model downloads/web tools. If anything is missing,
it shows the package commands and asks before installing prerequisites through
apt-get, dnf, pacman or zypper. Installation needs administrator access;
compilation runs as the user who launched the script. Run it as your normal user,
not with sudo bash build.sh. When prerequisites are already installed, no package
manager or administrator access is needed. On other distributions, install the
listed prerequisites manually. Only the Ubuntu/WSL build has been verified here;
other package-manager paths still need validation on their distributions.
bash build.sh --test # build the C tests and run the shell tests
bash build.sh --list-models # the models it can download (models.tsv), without building
bash build.sh --download-model # also download/verify the reference 24B model
bash build.sh --download-model=lfm2.5-8b # the 8B MoE instead (4.8 GiB)
bash build.sh --download-model=lfm3-1.7b # the small model instead (1.0 GiB)
bash build.sh --download-model=lfm3-1.7b,lfm2.5-24b # two of them
bash build.sh --download-model=lfm3-audio-2b # the speech model and its audio projector (1.2 GiB)
bash build.sh --no-install # build without installing anything (offline/CI)
bash build.sh --yes --test # allow missing-package installation without prompting
bash build.sh --native --jobs 4 # optimize for this CPU; not for distributing binaries
bash build.sh --helpThe script works from another working directory and rebuilds existing objects to
avoid reusing a build made with different compiler options. CC=gcc or CC=clang
selects a compiler executable; the usual CFLAGS setting is also supported.
--yes does not supply a sudo password: unattended setup needs root or existing
passwordless/cached sudo access. No full system upgrade is requested; on Arch,
keep the package database and system up to date using the normal distribution procedure.
The output is build/pithos. No model, Python, OpenCL SDK or GPU driver is
needed to compile. Model download is opt-in; the script does not install GPU drivers.
Use bash build.sh --download-model (or combine it with --test) to fetch the
13.5 GiB reference model into models/, or --download-model=ID[,ID...] for the models
listed by --list-models. The list lives in models.tsv: one line per model with its
file name, exact size, SHA-256, a revision-pinned https URL and a status (validated models
were checked against a reference; experimental ones are only downloaded when named).
Adding a model is one line there; a model's projector is the line ID.mmproj after it, and it
is downloaded with the model. For every model the script pins the Hugging Face revision,
checks free disk space, resumes interrupted transfers in a .gguf.part file, and
verifies the exact size and SHA-256 before renaming it to .gguf. An existing valid
model is verified and reused; an invalid existing model is preserved and reported
as an error. If a partial download fails verification, move it aside or remove it
before retrying. Interrupted downloads release their lock and keep partial data;
after a crash/power loss, a stale .download.lock directory may need removal once
you have confirmed no other download is running. --no-install prevents package
installation; combine it with --download-model only when you do want network access.
After downloading the reference model, try CPU inference:
./build/pithos --cpu -m models/LFM2.5-24B-A2B-Q4_K_M.gguf -p "Hello"
./build/pithos --server --cpu # web chat at http://127.0.0.1:8080GPU acceleration is optional and needs a working OpenCL or Vulkan driver (see
Choosing the GPU). In our WSL2 test, the CPU path passed; no OpenCL
device and only the software Vulkan driver were exposed, so GPU inference was not verified
there and the default choice stays on the CPU. Seeing the GPU in nvidia-smi alone does not
establish OpenCL or Vulkan support.
--test runs only the model-independent shell test, in a temporary folder. For
numerical tests, use the reference 24B MoE GGUF, not the smaller dense model:
./build/test_kernels models/LFM2.5-24B-A2B-Q4_K_M.gguf
./build/test_gpu models/LFM2.5-24B-A2B-Q4_K_M.gguftest_gpu may print no GPU and exit successfully: that is a skipped check.
For a manual build, make still works; make test only builds the test binaries.
Maintainers can check the setup/error-handling paths without changing system packages
with python3 tests/test_build_linux.py (Python is needed only for this optional check).
From the Pithos folder, the model in models/ is found automatically. Start the mode
you need and use Ctrl+C to stop it:
| Mode | Command |
|---|---|
| Interactive terminal chat | ./build/pithos |
| One answer, then exit | ./build/pithos -p "Hello, who are you?" |
| Web chat and OpenAI-compatible API | ./build/pithos --server |
| Web chat with shell/process tools available | ./build/pithos --server --shell |
| Terminal agent: approve each action | ./build/pithos --agent |
| Autonomous agent for one task | ./build/pithos --auto -p "Review this project" |
| Prompt/generation benchmark | ./build/pithos --bench |
| All command-line options | ./build/pithos --help |
With --server, open http://127.0.0.1:8080 in your browser; the API base URL is
http://127.0.0.1:8080/v1. Add --cpu to explicitly use the CPU, for example
./build/pithos --server --cpu. Autonomous mode still asks before commands it
recognizes as destructive; see Terminal agent for details.
GPU on Linux (Vulkan, experimental). With a Vulkan driver installed (NVIDIA's own driver, or
Mesa's RADV / ANV for AMD and Intel: sudo apt install libvulkan1 mesa-vulkan-drivers),
./build/pithos --list-gpus lists the devices, and --gpu vulkan runs LFM3 entirely on the
GPU (on a discrete NVIDIA GPU that is already the default). For MoE models, --gpu opencl+vulkan
gives Vulkan the prompt matmuls. Mesa's software driver (llvmpipe, a "CPU" device) is used only
when chosen by number with --gpu vulkan --gpu-device N: it is useful for testing, not for speed. Where a GPU's buffers are small (llvmpipe: 128 MB), larger matrices are split over
several, and a KV cache that does not fit makes Pithos fall back to the matmuls only, with a
message suggesting a smaller -c.
OpenCL on Linux. If Pithos exits right after loading the model, with no message, check that
the temporary folder is writable: NVIDIA's OpenCL compiler writes there and ends the program when
it cannot (for example when /tmp is a tmpfs with a full quota). Pointing it elsewhere is enough:
mkdir -p ~/.cache/pithos-tmp && TMPDIR=~/.cache/pithos-tmp ./build/pithos ....
To work on another project, run the agent from that project's folder and give
absolute paths to the executable and model (replace /path/to/Pithos):
cd /path/to/your-project
/path/to/Pithos/build/pithos \
-m /path/to/Pithos/models/LFM2.5-24B-A2B-Q4_K_M.gguf --agentOn macOS / MinGW, use make (or make NATIVE=1 to tune for the local CPU).
The x86-64 binary contains the portable scalar kernels, the AVX2/FMA/F16C ones and 128-bit
AVX/F16C ones for CPUs without AVX2 (Intel Ivy Bridge, AMD Jaguar as in the Xbox One), and picks
at runtime (--kernels avx forces the AVX set). On ARM64 the NEON kernels are used, with
dotprod when the build machine has it (Raspberry Pi 5, RK3588, Graviton 2+, Apple M); on CPUs
without it (Raspberry Pi 3 / 4) the Makefile builds for plain ARMv8. A binary built with
dotprod stops with "Illegal instruction" on those CPUs, so build on the machine that runs it.
The GPU is optional: OpenCL.dll / libOpenCL.so is loaded at runtime, so no SDK is needed to
build. The web interface and the GPU kernels are embedded in the executable as generated headers
(src/webui_html.h, src/kernels_cl.h), so Python is only needed to regenerate them
(tools/embed.py).
Pithos runs on an Xbox One in Developer Mode as a UWP app, Pithos.X Server. The console becomes an OpenAI-compatible server for your home network, with Pandora in the browser of any PC or phone, and the TV shows the server state and a chat with the model. Tested on an Xbox One S with LFM3-1.7B and LFM3-Audio-2B, one at a time, switched with one command (Models for the Xbox; the 24B model does not fit in the console's memory). With LFM3-Audio-2B the console also hears and speaks: you talk into the headset plugged into the controller, and the answer is shown and read aloud, all on the console (Voice and Talk mode).
The TV shows the state, a chat with the model, the addresses to connect to and the server log (screenshot). Below, in the browser of a PC on the same network: Pandora served by the console, with an answer generated by the Xbox at 26.6 tokens per second.
| Xbox One S, LFM3-1.7B Q4_K_M | Prompt | Generation |
|---|---|---|
| App mode, CPU only (8 threads) | 17.6 tok/s | 7.3 tok/s |
Game mode, Direct3D 12 (-t 6 --gpu d3d12) |
146 tok/s (121 at 1000 tokens) | 29.5 tok/s (26 after 1000 tokens of context) |
The console's CPU (8 AMD Jaguar cores) has no AVX2, so it uses the AVX kernels. In Game mode the app gets about 5 GB of RAM and Direct3D 12 on the GPU, which runs the whole forward pass: weights, KV cache and activations live in GPU memory, and only the logits come back.
With LFM3-Audio-2B loaded instead of LFM3-1.7B, the app adds voice. Nothing leaves the console: the headset's audio is transcribed, answered and spoken by the same model, on the Xbox.
- Push-to-talk in the chat. Plug a headset into the controller's 3.5 mm jack, hold RT, speak, release: the words appear as a chat message and the model answers. Y reads the last answer aloud (or stops it); Read aloud speaks every answer. Voice chooses the language of the transcription and of the speech (English, Italian, French, German, Spanish, Portuguese) and Reasoning the thinking level (off, low, medium, high; off by default, the fastest).
- Talk mode (the Talk mode button, or View): a full-screen assistant on a deep black background, with the Pithos mark, an aura and rings that follow the voice, neural-network layers with travelling pulses, the clock and subtitles for the question and the answer. Answers are short (one or two sentences) and always spoken. RT talks, Y repeats, LB/RB change the language, ↑/↓ the reasoning level, B or View go back to the chat.
- Hands-free (X in Talk mode): no button at all. The app listens for speech above the room's noise, sends the question after a short pause, and raises its threshold while it speaks, so its own voice does not trigger it.
Measured on the Xbox One S in Game mode: a spoken question is transcribed in under a second, the chat reuses the conversation already in the cache, and the first words of the answer play after 0.5–0.8 seconds. Speech is generated at about 0.87× real time: the depth decoder runs on the GPU in one pass per frame and the audio codec on the CPU alongside it, and the app buffers just enough audio before it starts that the answer plays without gaps.
The first time, the console asks for permission to use the microphone. If it was refused, enable it again in Settings → Privacy → App privacy → Microphone.
- The console in Developer Mode. Install the Xbox Dev Mode app from the Store on the console
and follow Microsoft's activation guide
(it needs a Microsoft Partner Center developer account). Then, in Dev Home, turn on the
Device Portal under the remote access settings. It answers at
https://CONSOLE-IP:11443. - A Windows PC on the same network with:
- Visual Studio 2022 with the MSVC v143 and C++ Universal Windows Platform tools components;
- the Windows SDK 10.0.26100 (it provides
makeappx,signtoolandfxc); - Python 3, for the deployment script (standard library only).
- One of the two models, downloaded on the PC (see Models for the Xbox).
- For voice: a headset with a 3.5 mm jack, plugged into the controller.
Two models run on the console. The app's storage holds one at a time (with both, the upload fails
with "not enough space on the disk"), and deploy.py use switches between them in one command.
| Model | Files to download | What you get on the Xbox | Speed (Game mode) | pithos.args |
|---|---|---|---|---|
| LFM3-1.7B | LFM3-1.7B-Q4_K_M.gguf (1.1 GB) |
text: the TV chat, Pandora and the API for the house | 146 tok/s prompt, 29.5 tok/s generation | -t 6 --gpu d3d12 --cache-mb 256 |
| LFM3-Audio-2B | LFM3-Audio-2B-Q4_K_M.gguf (1.1 GB) and its projector mmproj-LFM3-Audio-2B-Q4_K_M.gguf (0.17 GB) |
the same text features, plus push-to-talk, spoken answers, Talk mode and hands-free | ~28 tok/s generation, speech at 0.87× real time | -t 5 --gpu d3d12 --cache-mb 256 and a pithos.env (below) |
Download them on the PC into the models folder (LFM3-1.7B,
LFM3-Audio-2B), keeping the projector next to
its model with its original name: that is how use finds it. Then, with the app installed:
python xbox\deploy.py --xbox CONSOLE-IP use models\LFM3-1.7B-Q4_K_M.gguf text
python xbox\deploy.py --xbox CONSOLE-IP use models\LFM3-Audio-2B-Q4_K_M.gguf text and voice
use stops the app, deletes the other model (and its projector) from the console, uploads the
projector before the model, writes the recommended pithos.args (and for LFM3-Audio-2B the
speech lines of pithos.env, keeping any other line there), and starts the app again. The order
matters: the app starts as soon as a model has finished uploading, and a projector that arrives
later is not seen until the next restart, so the console would run without voice. Files already on
the console with the same size are not uploaded again, so use with the model that is already
there just rewrites the options and restarts. The upload takes a few minutes over the network.
Saved conversations. The server keeps each conversation on the console so it can continue
without reading it again (Prompt reuse), in a folder next to the model
(MODEL.gguf.pithos-cache, about 6–15 MB a conversation). On a PC they may take up to 4 GB; on the
console the pithos.args written by use caps them at 256 MB (--cache-mb 256, about 15–40
conversations), and the oldest are deleted when a new one is saved. When you switch model, use
moves the other model's conversations to the PC (build-xbox\conversations) and puts them back when
you choose that model again; --drop-cache deletes them instead.
If an upload fails with "not enough space on the disk": a failed upload leaves its copy in the
Device Portal's temporary folder until the console restarts. Restart the console, then run use
again (the files already there are kept). Crash dumps, if you enabled them, take space too
(Device Portal → App crash dumps).
--dry-runprints the steps without changing anything;--args "..."writes your ownpithos.args(for example--args "-t 8"in App mode);--keep-argsleavespithos.argsandpithos.envas they are;--no-launchdoes not start the app at the end.
The models are not deleted from the PC: switching back means uploading again.
From the Pithos folder, on the PC:
powershell -ExecutionPolicy Bypass -File xbox\make_cert.ps1 once: signing certificate
xbox\build.cmd -> build-xbox\Pithos.appx
make_cert.ps1 creates a self-signed certificate (CN=Pithos, the publisher in
xbox\Package.appxmanifest) in build-xbox\pithos_xbox.pfx. Developer Mode installs packages signed
this way. The build-xbox folder is not versioned: keep the certificate private, and do not
commit it. build.cmd compiles the same engine sources with PITHOS_UWP (file APIs allowed in an
app container, no child processes), the app shell xbox\app.cpp, and packs and signs the result.
xbox\deploy.py talks to the Device Portal (add --user / --password if you enabled portal
authentication):
python xbox\deploy.py --xbox CONSOLE-IP install the app and its VCLibs dependency
python xbox\deploy.py --xbox CONSOLE-IP use models\LFM3-1.7B-Q4_K_M.gguf a model, its options, start
python xbox\deploy.py --xbox CONSOLE-IP log the server log
python xbox\deploy.py --xbox CONSOLE-IP files the app's LocalState folder
python xbox\deploy.py --xbox CONSOLE-IP launch start the app
python xbox\deploy.py --xbox CONSOLE-IP stop stop it
python xbox\deploy.py --xbox CONSOLE-IP upload FILE put a file into LocalState
python xbox\deploy.py --xbox CONSOLE-IP get NAME download a file from LocalState
python xbox\deploy.py --xbox CONSOLE-IP rm NAME delete a file from LocalState
- Install the package.
- Switch the app to Game mode for Direct3D 12 and 5 GB of RAM. On the console: Dev Home → select Pithos.X Server → View details → App type: Game. This has to be done again after every reinstall, because installing resets the type to App.
- Put a model on the console with
use(Models for the Xbox): it uploads the model into the app'sLocalStatefolder with the recommended options, and starts the app. Launching from the portal works only while a user is signed in on the console; otherwise start Pithos from Dev Home. With--gpu d3d12the server answers about a minute after the start. - Connect from any device on the network: Pandora at
http://CONSOLE-IP:8080, the API athttp://CONSOLE-IP:8080/v1(model name: the file name without.gguf). The TV shows the same addresses.
To update the app, increase Version in xbox\Package.appxmanifest, rebuild, stop, install,
and set the app type to Game again. LocalState (the model, pithos.args and the saved
conversations) is kept across updates.
The app starts the server as pithos --server --host 0.0.0.0 --port 8080 --gpu off -m MODEL: the
CPU, since the GPU is reachable only in Game mode. The options in LocalState\pithos.args are
added after these, so they can also override them. use writes the recommended file for the
model; to change it, upload your own pithos.args (or use MODEL --args "..."), then restart the
app:
| Mode | Recommended pithos.args |
Why |
|---|---|---|
| Game (recommended) | -t 6 --gpu d3d12 --cache-mb 256 |
the GPU does all the work; 6 CPU threads leave room for the system; saved conversations stay within 256 MB |
| Game, with LFM3-Audio-2B | -t 5 --gpu d3d12 --cache-mb 256 |
the fifth free core runs the audio codec next to the GPU |
| App (no Game type) | -t 8 |
Direct3D 12 is not available; all 8 cores give the best CPU speed |
The older -t 6 --d3d12 still works the same.
For voice, use also writes a pithos.env file in LocalState (an app gets no environment
variables from outside; the app reads NAME=VALUE lines from this file) with:
PITHOS_SPEECH_DX=1
PITHOS_SPEECH_CODEC_THREADS=0
The first line runs the speech depth decoder on the GPU, the second keeps the codec on the engine's
threads. Together with -t 5 they give the 0.87× real time measured above; without them speech
runs at about half that speed.
- Start-up: with
--gpu d3d12the server answers about a minute after launch, while the weights are copied into GPU memory. The log linewhole forward pass on the GPUconfirms the fast path. - Context: the server uses 16,384 tokens by default (352 MB of KV cache on the GPU).
-c 8192halves it. - Batch:
-b 256gains only ~4% on long prompts over the default 64. - Reasoning: Pandora and the API choose the level per request; the TV chat has its own Reasoning button (off, low, medium, high), remembered by the app.
- Access: the server listens on the whole local network without a key. Add
--api-key KEYto require one on/v1. - Prompt reuse works as on the PC: conversations are saved in
LocalStateand continue after a restart, within the--cache-mbbudget (see Saved conversations). - The TV screen shows the state, the addresses, the end of the log, a chat with the model (without tools) and a button that stops the server; with LFM3-Audio-2B, also the voice buttons and Talk mode.
- From a PC terminal: the console is an ordinary OpenAI-compatible server, so any client can
chat with it, for example with
curl http://CONSOLE-IP:8080/v1/chat/completionsor any OpenAI client library. - What is missing on the console: there are no child processes, so no shell tools and no MCP
servers, and no
curl, so no web tools. Pandora's agent mode keeps the file tools (inLocalState\workspace), the calculator and the date.
build\pithos.exe --server (or server.cmd, which also opens the browser) starts a
dependency-free HTTP server (Winsock / POSIX sockets) with:
-
the Pandora web interface at
http://127.0.0.1:8080:- multi-turn conversations saved in the browser;
- streaming answers with Markdown (tables, code with a Copy button) and a collapsible reasoning section;
- a reasoning level selector next to the message box (High, Medium, Low, Off);
- with LFM3-Audio, a microphone button for dictation:
speak, click again, and the transcription lands in the message box to check before sending
(browsers allow the microphone on
localhostor https only); - and a Voice mode: the answer is read aloud with the model's voice while it streams, a sentence at a time, what you dictate is sent at once, and hands-free (Settings, on by default) the microphone opens again after each answer and stops by itself after a pause. Clicking the microphone or typing interrupts the voice;
- prompt-processing progress, stop, regenerate, edit the last message;
- system prompt and sampling parameters, light/dark theme.
It is a single file (
web/index.html) embedded in the executable, with no external resources. -
an OpenAI-compatible API:
-
POST /v1/chat/completionswith SSE streaming,reasoning_contentseparate from the answer,tools/tool_calls,stop,stream_options.include_usageandchat_template_kwargs.preserve_thinking, the reasoning controls described below; -
POST /v1/completionsandGET /v1/models; -
like llama-server, also
GET /health,GET /props,POST /tokenize,POST /apply-templateand thetimings/prompt_progressfields (return_progress: true); -
with LFM3-Audio and its projector next to it, speech:
input_audioparts (base64 WAV) in chat messages;POST /v1/audio/transcriptions(form fieldsfile,languageas an ISO code such asit,response_formatjson,textorverbose_json,temperature);POST /v1/audio/translations(the same fields: the speech as English text;language, optional, names the language spoken);POST /v1/audio/speech(input,voicefemaleormale,language,response_formatwav,pcmormp3,stream_formataudioorsse).GET /propssays so undermodalities.The speech streams: a
pcmormp3body grows as it is generated, so a player starts about half a second after the request instead of after the whole text; with"stream_format": "sse"the audio comes asspeech.audio.deltaevents (base64 of PCM, or of MP3 frames) and ends withspeech.audio.done, as in OpenAI's API. Awavbody comes at once (its header holds the length). MP3 (24 kHz mono, 48 kbit/s) uses the system's encoder, so the build needs no library: Media Foundation on Windows (not in N editions without the Media Feature Pack), libmp3lame elsewhere (thelibmp3lame0orlamepackage).
-
curl http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"Hello!"}]}'
curl http://127.0.0.1:8080/v1/audio/transcriptions -F file=@speech.wav -F language=en
curl http://127.0.0.1:8080/v1/audio/translations -F file=@parole.wav
curl http://127.0.0.1:8080/v1/audio/speech -H "Content-Type: application/json" \
-d '{"input":"Ciao!","language":"it"}' -o ciao.wav
curl -N http://127.0.0.1:8080/v1/audio/speech -H "Content-Type: application/json" \
-d '{"input":"Hello there!","response_format":"mp3"}' | ffplay -nodisp -autoexit -
Reasoning levels. None of the models has official effort levels: LFM3 has an on/off switch in its
template (enable_thinking), the LFM2.5 models always reason. Pithos adds the levels as reasoning budgets:
| Level | Behaviour |
|---|---|
high (default) |
the model reasons as long as it needs |
medium |
the reasoning is closed after 2048 tokens and the model moves on to the answer |
low (minimal) |
the same after 512 tokens |
off (none) |
the answer starts right away, after an empty <think></think> |
On the server, a request picks it with reasoning_effort (or reasoning: {"effort": …}), thinking_budget
(tokens, 0 = off) or chat_template_kwargs.enable_thinking: false; --reasoning sets the default for
requests without them (also in the terminal chat), and GET /props lists the levels under reasoning.
Measured on 30 GSM8K problems, off keeps the accuracy (LFM3 93%, LFM2.5-24B 97%) with 2–4 times shorter
answers; on harder problems (20 from MATH, LFM3) low cut the time by a third without losing accuracy. With the
reasoning off the models sometimes reason inside the answer anyway: when a </think> arrives there, the text
before it is moved to reasoning_content (in streaming, a delta with content_to_reasoning tells the
client to do the same).
The chat template is implemented in C following the Jinja template in the GGUF: system prompt, tools,
call arguments in the f(arg='v') format, and reasoning removed from past turns. tests/test_server.py
compares it with Jinja2 character by character and token by token. LFM2.5-8B-A1B ships an earlier
revision of the LFM2.5 template, and Pithos renders it like the 24B model's newer one: the
generation starts inside <think> (the token the model writes first anyway), quotes and
backslashes in tool-call arguments are escaped, lists in them are written as JSON, and kept
reasoning is also read from reasoning_content. Against that older template, test_server.py
reports exactly these differences; its arithmetic and raw-completion checks fail with this model too,
with the same answers llama.cpp gives (it reads "17 per 23" as 17/23).
LFM2.5-24B-A2B, LFM2.5-8B-A1B and LFM3 are trained to use tools, and can make more than one call per answer.
LFM2.5 writes calls as <|tool_call_start|>[f(arg='v')]<|tool_call_end|>, LFM3 as
<tool_call><function=f><parameter=arg>v</parameter></function></tool_call>; the server turns
both into OpenAI tool_calls, so clients see no difference.
- Turning it on: the Agent button under the text box enables tools. The model calls them, each call shows up as a card (arguments, result, time), and the loop goes on until the model answers.
- Confirmation: tools that change something ask for confirmation (Allow / Deny).
- Settings: you choose when to ask, the maximum number of steps and which tools are enabled.
Built-in tools, run by the server:
| Tool | What it does |
|---|---|
web_search, fetch_url |
DuckDuckGo search and page reading (HTML converted to text, in parts) through curl, which ships with Windows 10+, Linux and macOS |
list_directory, read_file, find_files, search_text, write_file |
files in the working folder (--workspace, default ./workspace); absolute paths and .. are rejected |
calculator, get_current_datetime |
exact arithmetic, local date and time |
The server starts with a 16k-token context, because tool results take space. The agent system prompt and the tool list (~1,200 tokens) stay cached after the first request, so each later step only processes the new result.
pithos --agent starts an agent session in the current folder: you give it a task, it works through
the tools until the task is done, then waits for the next one. The conversation continues across
tasks.
cd my-project
pithos --agent safe mode: every action needs your approval
pithos --auto autonomous mode: it works on its own until the goal is reached
pithos --auto -p "make the tests pass" one task, then exit
At start-up, while the model loads, it shows the Pandora mark and the Pithos name in 24-bit color. It also shows the operating system, the folder and the mode. Under 80 columns only the name is shown, and plain text is printed when the output is not a terminal.
Modes.
- Safe (default): each tool call is shown before it runs. You answer y (run it), n (skip it), a (always allow this tool for the session), or type what to do instead. Your words go back to the model.
- Autonomous (
--auto, or/autoduring the session): it plans, runs, checks and fixes on its own, up to--max-stepsmodel calls per task (default 40). Commands that look destructive still ask first: recursive deletes, formatting,git push,git reset --hard, killing processes, registry changes,sudo, piping downloads into a shell.--yoloturns these checks off.
Knows the system it runs on. At start-up the agent detects the operating system (name, version,
build, architecture), the shell, the working folder and the programs on the PATH (git, python, node,
gcc, cargo, docker...). It also receives the syntax rules of that shell. On Windows the rules say
that Windows PowerShell 5.1 has no &&, which cmdlets replace grep, rm -rf and head, and how
quotes behave. On Linux, bash syntax applies and sudo cannot ask for a password.
Commands it can check.
| Tool | What it does |
|---|---|
run_command |
runs a command and waits for it. Returns exit code, run time, stdout and stderr apart. Default timeout 120 s, then the command is stopped with everything it started. |
start_process |
starts a long-running program (server, watcher, npm run dev) and returns at once with an id and its first output |
read_process |
status (running / exit code), elapsed time and new output. Can wait for the end or for a text such as listening on |
stop_process, list_processes |
stop a background process (and its children), list them |
edit_file |
replaces an exact piece of text in a file (must be unique, CRLF files work too) |
These come on top of the file and web tools. Commands run without a terminal and without input, so a program waiting for an answer sees end of input instead of hanging. Pagers and colors are turned off. Output is cleaned of escape sequences and progress bars, and long output keeps its start and its end.
When a command fails, the model sees the exit code and the error and corrects itself. If it repeats
the exact same failing call three times, it is told to change approach. Ctrl+C stops the current
generation or command and gives the prompt back. During a session: /auto, /safe, /reset,
/tools, /help, /exit.
The shell tools are also available to Pandora with pithos --server --shell, behind the usual
Allow / Deny cards. Pandora receives the same system information and shell rules (GET /v1/tools
returns them as env). tests/test_shell.c checks them without the model (build.cmd test, then run
build\test_shell.exe from an empty folder).
Pithos is an MCP (Model Context Protocol) client. No
third-party server is bundled or configured: you add the ones you want in a mcp.json file. It
is read from the current folder, or from the path given with --mcp FILE. The file is listed in
.gitignore because it is local configuration.
The format is the same one used by Claude Desktop and other MCP clients:
{
"mcpServers": {
"myserver": {
"command": "npx",
"args": ["-y", "<npm-package>@<exact-version>"],
"env": { "SOME_SETTING": "value" }
},
"another": {
"command": "uvx",
"args": ["<pypi-package>==<exact-version>"],
"disabled": true
},
"local": {
"command": "python",
"args": ["-u", "path/to/my_server.py"]
}
}
}| Field | Meaning |
|---|---|
key (myserver) |
server name; its tools appear to the model as myserver__toolname |
command |
program to start: npx (Node.js), uvx (Python, from uv), python, or any executable |
args |
command-line arguments; relative paths are resolved from the folder Pithos runs in |
env |
extra environment variables for that server only (optional) |
disabled |
true keeps the entry without starting it (optional) |
How it works:
- Starting: each server is started as a child process and talks JSON-RPC over stdin/stdout (the stdio transport). Remote HTTP servers are not supported yet.
- Tools: the server's tools are added to the agent's list, and they can be switched on and off one by one in the web interface.
- Confirmation: tools that declare
readOnlyHintrun without asking; all the others ask for confirmation. - Shutdown: the servers stop together with Pithos, including the processes they start themselves
(
npx→node). Windows uses a job object, Linux a process group.
Checking a configuration without loading the model:
build\pithos.exe --tools-list lists built-in and MCP tools, with each server's state
build\pithos.exe --tool myserver__toolname "{\"arg\": 1}" calls one tool and prints the result
Over HTTP: GET /v1/tools returns the list in the OpenAI tools format plus the MCP server state,
and POST /v1/tools/call takes {"name", "arguments"}.
To write your own server, tests/mcp_test_server.py is a minimal one in plain Python (no SDK), and
tests/mcp_test.json shows how to load it. Ready-made servers are listed in the
official MCP registry and in the
reference servers repository.
Security. A local MCP server runs with your user's permissions, and its tool descriptions and results go straight into the model's context.
- Prefer official or well-known servers.
- Pin an exact version (
@1.2.3,==1.2.3) instead of always pulling the latest one. - Check the package's security advisories before updating.
- Give file-system servers a single folder, not your whole home.
- Do not leave test or debug servers running while secrets are in the environment: some of them can read environment variables back to the model.
The model is hybrid. The KV cache of the 10 attention layers can be cut at any point, but the state of the 30 convolution layers is recurrent, and going back needs a copy of it (480 KB) taken at that point. So the server keeps the token sequence that is in the context and a checkpoint of the recurrent state at the start of every message. Each request restarts from the longest common checkpoint and only processes the rest:
- New turn of a chat: only the new message is processed, e.g. 4–25 tokens instead of 100–200.
- Regenerate or edit the last message: processing restarts from the previous message.
- While you read an answer: the context is rewritten the way the template presents past turns (without reasoning), so the next turn matches exactly.
- On disk: conversations are saved to
MODEL.gguf.pithos-cache/(KV + checkpoints, ~20 KB per token) and reloaded when a request continues one. This works after a server restart too, and when switching between chats.--cache-mbsets the budget (default 4 GB); the least recent conversations are deleted first.--no-cachekeeps reuse in memory only.
| Option | Effect |
|---|---|
-m PATH |
GGUF file. Without it: models/LFM2.5-24B-A2B-Q4_K_M.gguf if present, otherwise the only .gguf in models/; with several, Pithos lists them. Also looked up in ../models and ../../models |
-p TEXT / -f FILE |
single prompt with the model's chat template |
-i |
interactive chat (default without a prompt). Commands /reset, /exit |
-s TEXT |
system prompt |
--audio FILE |
a WAV file the model hears before the prompt (LFM3-Audio); without -p, the audio alone is the message |
--mmproj FILE |
the audio projector (default: mmproj-<model name>*.gguf next to the model) |
--tts TEXT, -o FILE |
speak TEXT into a 24 kHz WAV file (LFM3-Audio; default speech.wav) |
--tts-voice V, --tts-lang L, --tts-temp F |
female (default) or male; the language as an ISO code (en, it, fr, ...); the temperature of the speech codes (default 1.0) |
--raw |
plain text completion without the template |
-n N |
max tokens per answer (default 4096, reasoning included) |
-c N |
context in tokens (default 8192, max 131072) |
-t N |
threads (default: physical cores) |
-b N |
prompt-processing batch (default 64; 256 when OpenCL alone takes the prompt on a dedicated GPU) |
--temp --top-k --top-p --min-p --repeat-penalty --seed |
sampling (defaults from the model card: 0.1 / 50 / 1.05) |
--reasoning R |
reasoning level: high (default), medium, low, off, or a budget in tokens |
--hide-think |
do not print the reasoning (<think>…</think>) |
--keep-think |
keep the reasoning of past turns in the context |
--gpu B |
the GPU backend: auto (default), off, vulkan, d3d12, opencl, opencl+vulkan, opencl+d3d12 (Choosing the GPU) |
--cpu |
CPU only (same as --gpu off) |
--gpu-device N |
device N of the --gpu backend, integrated GPUs too (numbers from --list-gpus; in a combination, the OpenCL device) |
--list-gpus |
list the OpenCL, Direct3D 12 and Vulkan devices |
--gpu-mem MB |
OpenCL: VRAM budget (default: VRAM - 900 MB) |
--no-gpu-dense |
OpenCL: in generation, use the GPU only for experts (attention, convolutions and output on the CPU) |
--no-gpu, --d3d12, --vulkan, --vulkan-device N |
the options before --gpu, still accepted with their old meaning (Choosing the GPU) |
--kernels K |
force the CPU kernels: auto, scalar or avx (the set for CPUs without AVX2) |
--prefetch / --no-prefetch |
expert read-ahead (default: on when the model exceeds the free RAM) |
--mlock |
try to lock the model in RAM |
--bench [PP,TG] |
benchmark with a per-operation profile (the context grows to fit PP unless --ctx is given) |
--ppl FILE |
perplexity with the same method as llama-perplexity |
--tokenize TEXT |
print the token ids |
--stats, -v |
detailed statistics |
--server, --host, --port |
HTTP server (default 127.0.0.1:8080; --host 0.0.0.0 for the local network) |
--open |
open the web interface when the server is ready |
--alias NAME, --api-key KEY |
model name in the API, key required on /v1 |
--cache-dir DIR, --cache-mb N, --no-cache |
prompt reuse on disk |
--ui FILE |
serve an external HTML file instead of the embedded interface |
--agent, --auto, --yolo |
terminal agent: safe mode, autonomous mode, autonomous without the checks on destructive commands |
--max-steps N, --show-think |
agent: model calls per task (default 40), stream the reasoning |
--workspace DIR |
folder for the file tools (default ./workspace; for the agent, the current folder) |
--shell |
also offer run_command and the process tools in the web UI |
--mcp FILE |
MCP servers to start (default ./mcp.json if present) |
--read-only, --no-web, --no-tools |
no write_file, no web tools, no tools at all |
--tools-list, --tool NAME [JSON] |
list / run one tool without loading the model |
--gpu says which backend does the work; --list-gpus shows the devices of each, and
--gpu-device N picks one (otherwise the dedicated GPU with the most memory).
--gpu |
What runs on the GPU | Best for |
|---|---|---|
auto (default) |
dense models (LFM3): the whole forward pass through Vulkan, on a discrete NVIDIA GPU only; models with experts (LFM2.5-24B and 8B), or without such a GPU: OpenCL as below, on a dedicated GPU; otherwise the CPU | not having to choose |
vulkan |
the whole forward pass of dense models; the matmuls of models with experts (Windows, Linux; experimental) | LFM3, fastest generation measured |
d3d12 |
the same through Direct3D 12 (Windows; Xbox in Game mode) | LFM3 on Windows, the Xbox |
opencl |
hot experts and all dense layers in VRAM, the other experts on the CPU in parallel; on a dedicated GPU with an int8 dot product in hardware, the prompt matmuls and the resident experts of the prompt too | the MoE models (LFM2.5-24B, 8B), fastest measured |
opencl+vulkan, opencl+d3d12 |
OpenCL as above, with the prompt matmuls on the other backend | GPUs where OpenCL leaves the prompt on the CPU |
off (--cpu) |
nothing | machines without a usable GPU |
Why the models differ: the 24B model (14.5 GB) does not fit in a 4 GB GPU, nor does the 8B one
(5.2 GB), and only the OpenCL backend keeps the most used experts in VRAM (55% of the 8B's experts
on the 4 GB GTX 1650); Vulkan and Direct3D 12 hold the dense layers only and
leave the experts, most of the work, on the CPU. LFM3 fits whole, and there the
whole-pass backends are about 1.3 times faster than OpenCL on the prompt and 1.5 times in generation. auto uses Vulkan only on NVIDIA, the
vendor it has been measured on; on integrated GPUs it stays off, since the CPU is faster there (on
the reference laptop's Intel UHD: 10 tokens per second of generation against about 20 on the CPU).
When a backend asked for explicitly cannot start, Pithos says why and runs on the CPU; it never
switches to another backend on its own.
Long contexts also favor Vulkan: OpenCL keeps a larger safety margin of VRAM free (900 MB plus
512 MB) and moves the dense layers back to the CPU when the KV cache does not fit within it. With
LFM3 on the 4 GB GTX 1650, OpenCL no longer fits from -c 81920 (CPU only: 64–68 / 18 tok/s),
while Vulkan keeps the whole forward pass up to -c 114688 (212 / 61) and the matmuls beyond
(-c 131072: 170 / 36).
Other GPUs. auto was measured on the reference laptop only. On AMD or Intel Arc cards it
chooses OpenCL, because Vulkan has not been tested there. Where the driver offers no int8 dot product
in hardware, OpenCL leaves the prompt on the CPU and --gpu opencl+vulkan may read it faster. In those cases compare the
backends on your machine with --bench (for example --gpu vulkan --bench against
--gpu opencl --bench) and keep the fastest; reports of the numbers are welcome.
The options before --gpu keep working with their old meaning: OpenCL by default, --no-gpu
turned it off, --d3d12 and --vulkan added a backend. So --no-gpu --vulkan is --gpu vulkan,
--d3d12 alone is --gpu opencl+d3d12, and --no-gpu alone is --cpu.
The chat template is the one in the GGUF:
<|startoftext|><|im_start|>user\n…<|im_end|>\n<|im_start|>assistant\n<think>.
As in the template, only the final answer of past assistant turns stays in the context. At the end of
each turn the state is rolled back to before the answer (KV cache + convolution state), and the answer
without its reasoning is processed again.
Any GGUF of the lfm2 (dense), lfm2moe or lfm3 architecture loads, as long as its tensors use
the supported formats: Q4_K, Q5_K, Q6_K, Q8_0, Q4_0, F16, F32. BF16, Q2_K, Q3_K and IQ formats are
not supported. GPU acceleration needs Q4_K / Q6_K weights (the Q4_K_M files; a Q4_0 file runs on
the CPU): MoE models keep their hot experts and
dense layers in VRAM, dense models (LFM3) all their layers. Validated so far: LFM2.5-24B-A2B,
LFM2.5-8B-A1B and LFM3-1.7B.
lfm3 adds to LFM2: an RMSNorm on the output of every block before the residual sum (sandwich
norm), a sigmoid gate per head on the attention output, sliding-window attention (256 tokens) on 5
of the 11 attention layers, partial RoPE on the others, a convolution window of 7, and its own chat
template (generation starts inside <think>, past turns keep an empty <think></think>).
lfm2moe: 40 hybrid layers, dimension 2048.
- 30 layers use a short convolution:
in_proj→ B·x → causal depthwise convolution with window 3 → C·y →out_proj. - 10 layers use GQA attention: 32 query heads, 8 key/value heads, head size 64, RMSNorm on q and k, NEOX RoPE with base 1e7.
- Feed-forward: the first 2 layers have a dense SwiGLU FFN. The other 38 have a MoE with 64 experts: sigmoid router with a selection bias, top-4, normalized weights.
- Embeddings: input and output embeddings are tied (Q6_K, 128,000 tokens).
The per-sequence state is small: a KV cache for only 10 layers (20 KB/token in f16) and 2 vectors for each of the 30 convolution layers.
| File | Contents |
|---|---|
src/gguf.c |
zero-copy GGUF reader on the memory-mapped file |
src/tokenizer.c |
GPT-2 byte-level BPE with LFM2's pre-tokenizer and special tokens; generated Unicode tables (tools/gen_unicode.py) |
src/model.c |
forward pass, KV cache, matmul scheduler, MoE, prefetch |
src/quant.c, quant_avx2.c, quant_neon.c |
Q4_K/Q5_K/Q6_K/Q8_0/Q4_0/F16/F32 formats; scalar, AVX2 and NEON kernels |
src/gpu_opencl.c, src/kernels.cl |
expert cache and dense layers in VRAM through OpenCL loaded at runtime |
src/gpu_d3d12.c, src/kernels_dx.hlsl, src/kernels_dx_token.hlsl |
Direct3D 12 backend: matmul kernels and the other steps of the forward pass (compiled into src/kernels_dx.h by tools\dx_shaders.cmd, which needs fxc from the Windows SDK) |
src/gpu_vulkan.c, src/kernels_vk.h |
Vulkan backend: the Direct3D 12 HLSL kernels compiled to SPIR-V (tools\vk_shaders.cmd or tools/vk_shaders.sh, which need dxc with SPIR-V support) |
src/quant_avx.c |
128-bit AVX/F16C kernels for CPUs without AVX2 |
xbox/ |
Xbox app: shell with the TV screen (app.cpp), Talk mode (talk.cpp), headset capture and playback (voice.cpp), manifest, build, signing and deployment scripts, GPU and microphone probes |
src/platform.c |
mmap, thread pool, prefetch, system info (Win32 / POSIX) |
src/sampler.c, src/main.c |
sampling, CLI, terminal chat |
src/server.c, src/json.c |
HTTP server, OpenAI API, chat template, tool calls, JSON |
src/audio.c |
LFM3-Audio speech input: WAV, resampling, log-mel features, the speech encoder and projector |
src/speech.c |
LFM3-Audio speech output: the depth decoder (MaskGIT), the LiquidCodec decoder, inverse STFT, WAV |
src/mp3.c |
MP3 output through the system's encoder, loaded at run time (Media Foundation, libmp3lame) |
src/pcache.c |
prompt reuse: recurrent-state checkpoints, sessions on disk |
src/tools.c, src/proc.c |
agent tools (files, web, shell commands, background processes), MCP client (JSON-RPC over stdio), child processes with pipes |
src/agent.c |
terminal agent: conversation, approvals, safe / autonomous modes (talks to the server in-process) |
web/index.html |
web interface (embedded into src/webui_html.h by tools/embed.py) |
web/talk.html |
the voice conversation page /talk (embedded into src/talk_html.h) |
web/brand/ |
Pandora logo: vector mark (currentColor), dark version for light UIs and light version for dark UIs (SVG, 512 px PNG), original in pandora-logo.jpg |
- Weights are never converted: the quantized format is read directly from the mapped file.
Activations are quantized to Q8_K (blocks of 256) and the dot products are integer
(
maddubs/maddon AVX2,sdoton NEON). - Hand-written AVX2 kernels keep scales and minimums in vector registers. On Q4_K they are 2× faster than the first version.
- Multi-token kernels unpack each weight block once for all the tokens of the batch (prefill).
- MoE grouped by expert: during prefill each expert is read once per batch for all the tokens that use it.
- Thread pool without a per-worker barrier: completion is counted per task, and tasks carry the generation number in the counter (64-bit CAS). A thread preempted by the OS does not block the others.
- Software prefetch a few rows ahead (+4%).
- Vectorized
expfor SiLU and softmax. The CRT version used to cost 22 ms per token.
- Asynchronous read-ahead: during prefill a thread asks the OS for large reads of the next layer
(
PrefetchVirtualMemory/madvise(WILLNEED)). Cold prefill is 2–3× faster. - Expert prediction: during generation the next layer's router is applied to the current state. 85% of the predicted experts are correct, and those not used recently are read ahead.
- Runtime loading:
OpenCL.dll/libOpenCL.sois loaded at runtime. Without a driver the engine stays CPU-only. - Expert cache in VRAM: VRAM holds a dynamic cache of the most used experts (547 of 2432
with 3 GB).
- Usage scores decay over time, and replacements happen in a separate upload thread.
- The profile is saved next to the model (
*.gguf.pithos-experts), so the next start is already warm.
- CPU and GPU in parallel: for each MoE layer the resident experts run on the GPU while the others run on the CPU. Submission to the driver happens in a dedicated thread. Once an expert is in VRAM it is dropped from the working set, so process RAM goes down by about 2.6 GB.
- Kernels: on NVIDIA (compute capability ≥ 6.1) they use
dp4athrough inline PTX with int8 activations. Elsewhere they use an f32 path with permuted local memory, free of bank conflicts. - Dense layers in VRAM (generation, one token at a time):
- What lives on the GPU: all the non-expert weights (0.63 GB), the KV cache, the convolution state and the residual stream.
- What the CPU does: only the non-resident experts. For each MoE layer the GPU sends it the state, the normalized input and the top-k choice in a single 8 KB read. The GPU runs its own experts while the CPU runs the others, and adds the CPU part when it arrives.
- Kernel fusion, to cut launches to ~200 per token:
- RMSNorm inside the matrix-vector products;
- q/k/v in one launch;
- norm + router + top-k in one kernel (the last work-group picks the experts);
- q/k preparation inside attention.
- Prompt: the CPU batch path, with its matmuls on the GPU where the driver has an int8 dot
product in hardware (dedicated GPUs: PTX
dp4aon NVIDIA,cl_khr_integer_dot_productelsewhere). They reuse the dense weights already in VRAM: Q8_K activations from the CPU, 64 rows × 64 tokens per work-group with int8 tiles in local memory, a matrix-vector kernel below 32 tokens. The resident experts are grouped by expert into tiles of up to 64 tokens, with the activations quantized on the GPU; there the prompt batch grows to 256 tokens (unless-bis given) so the tiles fill up. The KV cache and the convolution state are synced only when switching between the prompt and generation paths. - Portability: the kernels are built for what the driver reports. The int8 dot product
comes from PTX on NVIDIA, from
cl_khr_integer_dot_productwhere it is accelerated, and is emulated otherwise; if those builds fail, an f32 build is used. Intel GPUs get their own matrix-vector kernels (64 values per lane, work-groups of 128).
- Runtime loading:
d3d12.dllis loaded at runtime, and the shaders are precompiled DXBC (shader model 5.0), so they also run on the Xbox One's GPU. The adapter with the most dedicated memory is used. - Weights: every Q4_K / Q6_K matrix is copied once into GPU memory. Q6_K blocks are repacked from 210 to 212 bytes, so that the shaders read aligned words.
- Matmuls: tiles of 64 rows × 64 tokens for batches. Below 12 tokens, groups of 8 rows of one token use integer dot products on the Q8_K activations, like the CPU kernels.
- Whole forward pass (dense models): a token, or a prompt chunk of up to
-btokens, is recorded into one command list and submitted once. It covers the norms and residual sums, Q8_K quantization, q/k norm with RoPE and the KV cache writes, attention, the short convolution and SwiGLU. For a chunk, the convolution runs causally over all of its tokens at once, and attention uses a running softmax per head and token. Only the logits of the last token are read back. - State: the GPU keeps its own KV cache and convolution state, synced with the CPU copies only when a request needs the other path (for example, a snapshot for prompt reuse).
- Same kernels: the Direct3D 12 HLSL is compiled to SPIR-V with DXC, so both backends compute the same thing: on the same GPU their results are bit-identical. The D3D12 root signature becomes one descriptor set (UAVs at bindings 0-2, SRVs at 8-9, the constants at 16, from a ring of uniform buffer slots).
- Aligned layouts: SPIR-V has no 16-byte load from a byte-address buffer, and the four 4-byte
loads it gets instead made the matrix-vector kernels 1.5-2.3 times slower on the Intel UHD. So
Vulkan stores the Q8_K activations (qs first, then d: 272 bytes) and the Q6_K blocks (224 bytes)
16-byte aligned, and those kernels read them through
uint4views of the same buffers (thePITHOS_VKbranches inkernels_dx.hlsl; the Direct3D 12 bytecode does not change). Generation got 2.4 times faster on the Intel UHD and 20% faster on the GTX 1650, now ahead of Direct3D 12. - Intel kernels: Intel GPUs get their own build of the four matmul kernels; other GPUs load the
same ones as before (
PITHOS_VK_INTEL=0gives Intel those too). For decoding, the matrix-vector kernels are limited by the UHD's integer units, not by memory (reading the same weights without the arithmetic runs twice as fast): 8 lanes per row in groups of 128 threads instead of 32 in groups of 256, and for Q4_K two pairs of products per 32-bit multiply, with the activations made unsigned so that the halves never carry. For prompts, the tiled kernels were limited by reading the weights from group-shared memory: each thread now computes 8 rows x 4 tokens instead of 4 x 4, so each read serves twice the products. LFM3 on the UHD: prompt 35 -> 53 tokens per second, generation 8.4 -> 10 (the CPU: 85 / 21). - Runtime loading:
vulkan-1.dll/libvulkan.so.1is loaded at runtime, with its own minimal declarations (no Vulkan SDK). Each command buffer is submitted once per token or prompt chunk, as with Direct3D 12, and the CPU polls its fence for up to 50 ms: the driver's wait wakes up about 1 ms late, 5% of a token. - Buffer limits: a matrix larger than the device's largest storage buffer is split by rows over up to 8 buffers, one dispatch each. Bindings that are not at a multiple of the device's offset alignment (64 bytes on Intel) are copied to an aligned place first.
build\test_kernels.exe MODEL: every kernel (scalar and AVX2) against the reference dequantization on real model rows (relative error ~1e-8).build\test_gpu.exe MODEL: experts computed in VRAM against an f32 reference (f32: 3e-7; int8: ~9e-3, like the activation quantization on the CPU).build\test_dx.exe MODEL(Windows): every Direct3D 12 matmul shape against the CPU (relative error ~1e-6). Then the whole forward pass on real text, mixing prompt chunks of 100, 24 and 5 tokens with single tokens. The mean probability of the actual next token matches the CPU (NLL 2.678 vs 2.692), and so does the top choice (93%, the level of int8 rounding noise; the CPU kernels differ among themselves in the same way).build\test_vk.exe MODEL [DEVICE](Windows and Linux): the same checks for Vulkan. Results match Direct3D 12 exactly on the GTX 1650, and pass on Intel UHD and on Mesa's llvmpipe (WSL).- Tokenizer identical to Hugging Face
tokenizers(each model'stokenizer.json) and tollama-tokenize, on texts with accents, numbers, spaces, code, CJK, emoji and special tokens. - Perplexity compared with
llama-perplexity(table above). - LFM3-Audio-2B: log-mel features against the model's feature extractor (torch.stft and
transformers' Slaney filters): mean difference 1e-6. Encoder and projector against a float64
PyTorch implementation written from
modeling_lfm3_audio.pyon the same dequantized weights: downsampler output within 0.01% once the reference rounds its inputs to int8 as Pithos does, encoder output within 0.4%, embeddings within 2% (cosine 0.9997; the projector multiplies in float, because int8 inputs would add about 7% there). Transcriptions equal to llama.cpp's. Speech output against the same kind of reference, written frommodeling_lfm3_audio.pyandmodeling_liquid_codec.py: depth decoder logits within 1.7% (the same most likely code in 94% of the cases; the rest are near ties); codec output within 1.3%, as far as the reference itself moves when it rounds its inputs to int8 like Pithos; inverse STFT exact (141 dB). The spoken test sentences transcribe back word for word. - LFM3-1.7B: perplexity against an independent PyTorch implementation written from the model's
modeling_lfm3.py, on the same dequantized weights: 4.45 vs 4.39 with 256-token windows, 3.65 vs 3.62 with 1024 (sliding window active). The gap is the int8 activations and the f16 KV cache. On the GPU, token by token (--ppl -b 1): 4.390 / 3.622 with the f32 kernels, the reference's 4.390 / 3.621; 4.408 / 3.626 with the int8 (dp4a) ones. - LFM2.5-8B-A1B: tokenizer identical to
llama-tokenize(10,599 tokens of this README); perplexity againstllama-perplexityb12179 on 3,825 tokens of this README (512-token windows, CPU): 30.52 vs 30.34, a gap like LFM3-1.7B's on the same text (16.15 vs 16.00). On short texts (about 1,000 tokens) MoE perplexity moves by ±2% with rounding alone (scalar against AVX2 kernels), so compare on longer ones. python tests/test_server.py(with the server running): template against Jinja2, answers, streaming, prompt reuse across turns, tool calls, completions, stop strings, errors.python tests/versus.py [ROUNDS] [llama.cpp|llama.cpp-cuda]: head-to-head with llama-server (the paths of the llama.cpp builds are at the top of the script).build\test_shell.exe(from an empty folder): shell tools without the model, covering exit codes, stderr, timeouts, working folder, background processes,edit_fileand destructive-command checks.python tests/test_tools.py(server started with--mcp tests/mcp_test.json): built-in tools, workspace isolation, web, MCP client (pagination, errors,readOnlyHint) with the test MCP servertests/mcp_test_server.py.
| Variable | Effect |
|---|---|
PITHOS_COLOR=1 / 0 |
colors even when the output is a pipe (e.g. less -R) / never |
PITHOS_PF=N |
rows of software prefetch (default 4) |
PITHOS_GPU_PROFILE=1 |
GPU kernel timings |
PITHOS_GPU_SYNC=1 |
sync after every kernel (debug) |
PITHOS_GPU_NODP4A=1 |
force the f32 path |
PITHOS_GPU_DOT=ptx, khr, emu, f32 |
OpenCL: the int8 dot product (default: the best the driver offers) |
PITHOS_GPU_LPR=N |
OpenCL: lanes per matrix row, 8 to 64 (default 8) |
PITHOS_GPU_MVWG=N |
OpenCL: matrix-vector work-group size, 64 to 256 (default 256, 128 on Intel) |
PITHOS_GPU_INTELMV=0 / 1 |
OpenCL: Intel matrix-vector kernels off / on (default on Intel) |
PITHOS_GPU_PINNED=0 / 1 |
OpenCL: transfers through ordinary / pinned (mapped) host memory (default: pinned on dedicated GPUs; the Linux Intel driver fails on mapped pointers on integrated GPUs) |
PITHOS_GPU_BUILDLOG=1, PITHOS_GPU_CLOPTS=... |
OpenCL: print the kernel build log; extra build options |
PITHOS_CL_MIN=N |
OpenCL: prompt matmuls on the GPU from N tokens, 0 never (default 8 on dedicated GPUs with a hardware int8 dot, else 0) |
PITHOS_CL_TILE=N, PITHOS_CL_TT=N |
OpenCL: tokens from which the tiled kernel is used (32); tokens per matrix-vector pass (8) |
PITHOS_GPU_MOETILE=0 / 1 |
OpenCL: prompt experts in tiles off / on |
PITHOS_CL_CHECK=1 |
OpenCL: redo every prompt matmul on the CPU and report the differences (debug) |
PITHOS_GPU_RPW=N |
rows per group of 32 lanes in the GPU kernels |
PITHOS_GPU_DENSE=0 |
same as --no-gpu-dense |
PITHOS_GPU_EAGER=0 / 1 |
do not flush / flush the queue after every kernel (default: flush, except on Intel) |
PITHOS_GPU_LOOKAHEAD=1 |
queue the next layer behind a user event (slower with NVIDIA drivers on Windows) |
PITHOS_DX_DENSE=0 |
Direct3D 12: matmuls only, the rest on the CPU |
PITHOS_DX_CHUNKS=0 |
Direct3D 12: prompt chunks go through the CPU path (only single tokens run whole on the GPU) |
PITHOS_DX_MIN=N |
Direct3D 12, matmuls-only path: batches of fewer than N tokens stay on the CPU (default 1) |
PITHOS_DX_DEBUG=1 |
enable the Direct3D 12 debug layer and print its messages |
PITHOS_VK_DENSE=0, PITHOS_VK_CHUNKS=0, PITHOS_VK_MIN=N |
Vulkan: as the three PITHOS_DX_* above |
PITHOS_VK_INTEL=0 |
Vulkan: on Intel GPUs, the common matmul kernels instead of the Intel build |
PITHOS_VK_SPIN=MS |
Vulkan: how long the CPU polls a submit before waiting in the driver (default 50) |
PITHOS_VK_MAXBUF=MB |
Vulkan: a lower buffer size limit, to test the splitting of large matrices |
PITHOS_VK_FAIL=N |
Vulkan: simulate a GPU failure at the Nth whole-pass submit, to test the fallback to the CPU |
PITHOS_CL_FAIL=N |
OpenCL: simulate a GPU failure at the Nth generated token, to test the fallback to the CPU |
PITHOS_SPEECH_DUMP=PREFIX, PITHOS_SPEECH_ORDER=fixed, PITHOS_SPEECH_PROFILE=1 |
--tts: write the hidden states, codes, logits, codec output and audio of every frame (PREFIX.hid, .codes, .logits, .polar, .pcm); reveal the codebooks in a fixed order (for comparisons); print the time per frame of each part |
PITHOS_AUDIO_DUMP=PREFIX |
--audio: write the log-mel features, the encoder input and output and the embeddings as raw f32 files PREFIX.mel, .pre, .hid, .emb |
Planned improvements, in order of priority, are in ROADMAP.md.
- Only the
lfm2/lfm2moe/lfm3architectures. Formats Q4_K, Q5_K, Q6_K, Q8_0, Q4_0, F16 and F32; on the GPU only Q4_K and Q6_K. With OpenCL only decoding runs on the GPU, and the prompt is read on the CPU. Direct3D 12 runs the whole forward pass of dense models only: for MoE models it takes just the prompt matmuls.--ppl(logits of every token) uses its matmuls-only path. Vulkan, the same. - Vulkan is experimental: tested on an NVIDIA GTX 1650 and an Intel UHD (Windows) and on llvmpipe (Linux, WSL). On the Intel UHD it is correct but slower than the CPU.
- The Xbox app has been tested on an Xbox One S only, with LFM3-1.7B and LFM3-Audio-2B. It needs the app type set to Game again after every reinstall. The app's storage holds one model at a time, and speech on the console runs at about 0.87× real time, so a long spoken answer starts after a longer buffering wait.
- LFM3's sliding-window layers keep the whole KV cache like the others (simpler; a ring buffer would save almost half of it at long contexts).
- The NEON kernels and the GPU f32 path are written for ARM64/AMD/Intel, but have only been tested on x86-64 and NVIDIA. The POSIX shell/process tools have also passed tests on x86-64 Ubuntu 26.04 under WSL2; the macOS path remains unverified.
- On Windows (WDDM) every queued command costs ~20 µs in the driver. With the dense layers on the GPU this leaves ~200 launches and one sync per MoE layer, about 21 ms per token on top of the experts. The current limit is computing the non-resident experts on the CPU (30–45 ms per token on the reference laptop).
- The server handles one request at a time and the others wait in a queue, because the context and the expert cache are shared.
- Web interface conversations live in the browser's
localStorage. - LFM3-Audio: speech comes in as WAV only (no MP3 / Opus / WebM input) and goes out as WAV, PCM or MP3; one audio request at a time (others wait). The model's own spoken answers are English only; other languages go through transcription and speech synthesis. In a spoken conversation the model hears the last three exchanges again at each turn (their audio is not kept in the prompt cache). No vision models.
Pithos is released under the MIT License. The license covers the engine's code only; the model weights keep their own license.
The quantized block formats and the perplexity method are compatible with ggml/llama.cpp (MIT). The
vectorized exp approximation follows ggml_v_expf. The model architecture and weights are by
Liquid AI; the weights are distributed under the LFM Open License v1.0
(see the model card).


