Skip to main content

One sphere is cut into pieces and reassembled into two, forming the banach logo

Banach

Run AI models bigger than your RAM. Faster than llama.cpp. Byte-for-byte the same answers.

PyPI CI License Buy me a coffee

Watch the film  |  Install  |  60-second start  |  Benchmarks


A 22 GB model on a 16 GB machine

Qwen3.6-35B-A3B (Q4_K_M, 22.1 GB) on a 4-core cloud VM with 16 GB of RAM, no swap and a 1.27 GB/s disk. Cold start, same prompt, same greedy decode.

stock llama.cpp Banach
Prompt processing 7.64 s 3.44 s 2.2x faster
Generation 4.89 tok/s 5.40 tok/s +10%
RAM for experts all it can take 10 GB, capped the rest of your machine stays usable
Output reference identical every token, every logit, bit for bit

Squeeze the RAM budget further and race llama.cpp paging experts in at that same budget: 2.1x faster generation (details).

No approximations, no re-quantizing, no quality loss. The exact weights stay on disk; Banach just moves them better.

How

A Mixture-of-Experts model only uses a few of its experts per token. When the file does not fit in memory, plain llama.cpp leaves it to the operating system, which pages bytes in 4 KB at a time with no idea which experts come next. Banach knows the model:

  • It plans before you download. banach plan hf:... reads a few MB of headers and tells you the speed to expect on your machine and how the model splits across GPU, RAM and disk.
  • It streams experts on purpose. Whole experts, fetched in parallel the moment the router picks them, held in a RAM budget you choose, with the most-used experts kept hot.
  • It proves it. Every configuration is checked against stock llama.cpp token for token. Optional faster low-precision experts come with a live fidelity meter, so a shortcut is never silent.

The name comes from the Banach-Tarski paradox: one ball, cut into pieces and reassembled, becomes two. More model than your machine should hold.

Install

pip install banach

That is the whole install: the banach command and its engine, prebuilt for Linux x86_64, Linux arm64 and macOS on Apple Silicon. Windows and GPU builds: from source.

60-second start

  1. See the speed before you download. This reads a few MB of headers, not 22 GB:

    banach plan hf:unsloth/Qwen3.6-35B-A3B-GGUF/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf
    
  2. Serve it with an OpenAI and Anthropic compatible API. --lazy starts answering while the file is still downloading:

    banach serve hf:unsloth/Qwen3.6-35B-A3B-GGUF/Qwen3.6-35B-A3B-UD-Q4_K_M.gguf --lazy
    
  3. Use it from anything that speaks OpenAI or Anthropic, coding agents included (tool use works on both APIs):

    from openai import OpenAI
    client = OpenAI(base_url="http://127.0.0.1:8080/v1", api_key="local")
    print(client.chat.completions.create(
        model="local", messages=[{"role": "user", "content": "Hello!"}]).choices[0].message.content)
    
    import anthropic
    client = anthropic.Anthropic(base_url="http://127.0.0.1:8080", api_key="local")
    print(client.messages.create(
        model="local", max_tokens=200, messages=[{"role": "user", "content": "Hello!"}]).content[0].text)
    
  4. Watch it at http://127.0.0.1:8080/banach/status: engine, fidelity meter, download.

Runs everywhere

Platform Backends Expert streaming
Linux x86_64 and arm64 CPU (AVX2, AVX-512, NEON), CUDA, Vulkan full: hard RAM budget, parallel prefetch, residency checks
Windows x86_64 CPU (CUDA and Vulkan from source) prefetch, working-set budget
macOS, Apple Silicon CPU, Metal prefetch, soft budget
Any GPU --gpu-layers N dense layers on the GPU, experts streamed from RAM

Byte-exact against stock llama.cpp in CI on every commit, on Linux x64, Linux arm64 and Windows; CUDA and Vulkan builds are compiled in CI too.

Features

Preflight speed estimate and memory split from headers alone, before any download
Lossless streaming RAM budget for experts, parallel whole-expert fetch, frequency-gated admission, background eviction
GPU offload dense layers and KV cache on CUDA, Metal or Vulkan; experts stay in RAM
APIs OpenAI /v1/chat/completions and Anthropic /v1/messages, streaming, tool use, prefix cache
Downloads resumable, hot experts first, SHA-256 verified; serve before the download ends
Fidelity meter shadow replay against the exact model with anytime-valid confidence bounds

Commands

Command What it does
banach plan MODEL speed estimate and memory split for your machine, from headers
banach serve MODEL local OpenAI and Anthropic compatible server (--lazy, --gpu-layers N)
banach run MODEL -p TEXT one generation with the planned expert budget
banach pull hf:... resumable, prioritised, verified download
banach probe measures your memory bandwidth, compute and disk
banach inspect MODEL experts, bytes per token, KV per token
banach calibrate MODEL --measured TOK_S tunes the planner to your machine from one run
banach certify FLIPS confidence certificate on a recorded fidelity run

Build from source

git clone https://github.com/gautam1858/banach && cd banach
cargo build --release
git clone https://github.com/ggml-org/llama.cpp ../llama.cpp
(cd ../llama.cpp && git checkout 9309bf1 && git apply ../banach/engine/patches/0001-banach-precision-ladder.patch)
cmake -S engine -B build-engine -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLAMA_DIR=$PWD/../llama.cpp
ninja -C build-engine banach-engine
export BANACH_ENGINE=$PWD/build-engine/banach-engine
  • GPU: add -DGGML_CUDA=ON or -DGGML_VULKAN=ON to the cmake line (Metal is on by default on macOS) and serve with --gpu-layers 99.
  • Windows: the same steps from a Visual Studio developer prompt; the engine is build-engine\banach-engine.exe.
  • A source build is tuned for your exact CPU and is faster still than the prebuilt binaries.

Good to know

  • One request at a time; concurrent requests queue.
  • The hard RAM budget is Linux; macOS and Windows give identical output with a softer budget.
  • Small models (1 to 3B) call tools fine but are weak coding agents; use a bigger model for agent work.

Every number in this README, with machine, model, commit and command: docs/VALIDATION.md.

Support

Banach is free and open source. If it saves you a hardware upgrade, help fund test machines and GPUs for the next round of benchmarks:

Buy me a coffee

Credits

Built on llama.cpp and ggml (MIT), which run every kernel. Shaped by the llama.cpp expert-streaming pull requests (25294, 31469) and MoE cache (29887), by colibri's lossless NVMe streaming and published measurements, and by research on expert locality (Si et al., Liang et al.), mixed-precision experts (SliceMoE, DyMoE, HOBBIT) and betting confidence sequences (Waudby-Smith and Ramdas).

License

Apache-2.0, see LICENSE.

Metadata

Release files for banach 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for banach 0.1.2
File Interpreter ABI Platform Actions
banach-0.1.2-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for banach-0.1.2-py3-none-manylinux_2_28_x86_64.whl
banach-0.1.2-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for banach-0.1.2-py3-none-manylinux_2_28_aarch64.whl
banach-0.1.2-py3-none-macosx_14_0_arm64.whl Python 3 none macOS 14.0+ ARM64 Details for banach-0.1.2-py3-none-macosx_14_0_arm64.whl

Total release size: 18.3 MB

Release files / banach-0.1.2-py3-none-manylinux_2_28_x86_64.whl

Download URL banach-0.1.2-py3-none-manylinux_2_28_x86_64.whl
Size 6.3 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
1c86938ece1f812d9fe339d8cfd2dd8b5714c70173bff4cae4c0e0ad758ad68f
BLAKE2b-256 checksum
How to use checksums
e5530f055b86150f56b29f2ca60e65370bb7dc53ed2143a756591cdd29f6904b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / banach-0.1.2-py3-none-manylinux_2_28_aarch64.whl

Download URL banach-0.1.2-py3-none-manylinux_2_28_aarch64.whl
Size 6.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
cc90aef1166c7b88184b017eff26e8720c60ac8694a316364bf00adf698ca66e
BLAKE2b-256 checksum
How to use checksums
129bb05d0620c02c821150b8390217d38abf8cda6be42743bd7283894ee7695e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / banach-0.1.2-py3-none-macosx_14_0_arm64.whl

Download URL banach-0.1.2-py3-none-macosx_14_0_arm64.whl
Size 6.0 MB
Tags Python 3 macOS 14.0+ ARM64
SHA-256 checksum
How to use checksums
4d38f3a9794c52240aa4c4ce3283ffc29c2129f4b890c623d7053dd541d78040
BLAKE2b-256 checksum
How to use checksums
dc22172b9291417ccae036fb82a5bac153655c516306fca4bab3c3f37165c9bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for banach 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for banach-0.1.2-py3-none-manylinux_2_28_x86_64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

3 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page