Skip to content
Projets

À propos

Run real AI models on the GPU you already own: language, speech, image and video models from one engine and one container format, with or without PyTorch. NVIDIA GPUs, Mac GPUs through Metal, CPU; other GPUs experimental. Apache 2.0.

Design et médias

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
-1
in 7 days
0
in 15 days
+7
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

NeuroBrix logo

NeuroBrix

Run real AI models on the GPU you already own. No PyTorch required.
Language, speech, image and video models from one engine and one container format.

PyPI License: Apache 2.0 NeuroBrix Hub GitHub stars Featured in Python Weekly #771

A terminal: neurobrix serve loads TinyLlama, then neurobrix chat answers a question about GPUs, streamed token by token

pip install neurobrix                      # the Triton engine: no PyTorch
neurobrix import TinyLlama/TinyLlama-1.1B-Chat-v1.0 --accept-license
neurobrix run --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --prompt "Write a Python function that reverses a string."

Why NeuroBrix

  • Your hardware, not a rented API. NeuroBrix plans where each part of a model runs from your machine's hardware profile and the model's container: one GPU, several GPUs, streamed through GPU memory, or offloaded to the host. A request that does not fit is refused with the figures, never silently degraded.
  • One engine for every family. A mixture-of-experts language model, a speech recognizer and a video diffusion model run through the same engine from the same .nbx container: 54 models on the hub, no pipeline per model.
  • No PyTorch underneath, if you want. The Triton engine runs on nbxtensor, our tensor library, with kernel settings certified per GPU class against a float64 reference. The PyTorch engine runs the same container, so each can be checked against the other.

Runs on hardware you own

Hardware Status
NVIDIA GPUs on Linux Supported (both engines: Triton and PyTorch). See Hardware for architecture profiles.
NVIDIA GPUs on Windows Supported (PyTorch engine --compiled default; --triton with triton-windows>=3.5.0).
Mac GPUs (Metal) Supported on both engines ( Triton via python -m nbxtensor install-metal, PyTorch via MPS).
CPU (x86-64) Supported (PyTorch engine).
AMD & Intel GPUs Supported via nbxtensor (HIP / Level Zero); hardware reports welcome: open an issue.

Three things to try, one command each:

neurobrix run --model hexgrad/Kokoro-82M --prompt "Hello from my own GPU." --speaker af_heart --output speech.wav  # text to speech
neurobrix run --model openai/whisper-large-v3-turbo --audio recording.wav                                          # speech to text
neurobrix run --model ostris/Flex.1-alpha --prompt "a lighthouse at dusk" --output lighthouse.png                  # text to image

If NeuroBrix runs a model for you, a ⭐ helps other people find it.

Hub  |  Documentation  |  Releases  |  Contributing  |  GitLab mirror


What NeuroBrix does

  • One engine and one container format for every family it runs. A model is shipped as a .nbx container that holds its computation graph, its weights, the way its components connect, and its runtime defaults. The engine reads all of that from the container. There is no hand-written pipeline per model: the same runtime executes a mixture-of-experts language model, a speech recognizer, a text-to-speech model and a video diffusion model through a small set of generic execution flows (autoregressive decoding, iterative denoising, encoder-decoder, and others).
  • Two independent compute branches over the same container. The default branch runs the graph through PyTorch (ATen, with cuDNN and cuBLAS on NVIDIA GPUs). The Triton branch (--triton) runs the same graph through nbxtensor, NeuroBrix's tensor library (its Triton kernels and its tensor type), instead of PyTorch's operator library. The branches share the container and the placement plan, not compute code, so one can be checked against the other.
  • Placement is computed, not configured. NeuroBrix reads the machine's devices and memory from its hardware profile and plans where each component runs: on one GPU, across several GPUs, streamed through GPU memory, or offloaded to host memory. neurobrix run --explain-plan prints the chosen plan and the alternatives it rejected, without loading the model.
  • A request that does not fit is refused with figures. When the plan cannot hold a request on your hardware, NeuroBrix stops with an error that names what was needed and what was available, rather than silently degrading the output.

.nbx containers are built from the original published weights. To run a model you need only NeuroBrix: neurobrix import downloads ready-made containers from the hub.


Install and first run

NeuroBrix requires Python 3.10 or newer. See the releases page for published versions and release notes.

It has two engines. The Triton engine (--triton) runs on nbxtensor and Triton and needs no PyTorch. The PyTorch engine (--compiled) needs PyTorch, installed from the index that matches your hardware. With no mode flag, a run takes the PyTorch engine where PyTorch is installed and the Triton engine where it is not, and its launch line says which.

Triton engine, NVIDIA GPU (Linux). Install the NVIDIA driver, then:

pip install neurobrix
neurobrix doctor

and run; without PyTorch the run takes the Triton engine (engine: triton (torch not installed)). The CUDA runtime library comes with nbxtensor; nothing else is needed.

PyTorch engine (Linux / Windows). Install NeuroBrix, then run neurobrix setup --branch pytorch (or neurobrix setup on Windows, where PyTorch is the default branch) — it detects your OS, GPU, and driver and installs the matching PyTorch build automatically (avoiding the default PyPI wheel mismatch where PyTorch cannot see your GPU):

pip install neurobrix
neurobrix setup --branch pytorch
neurobrix doctor

On Windows, neurobrix setup also deploys the Microsoft Visual C++ runtime app-locally if c10.dll cannot load (no administrator prompt).

NVIDIA V100 (Volta). Current CUDA 13 builds of PyTorch no longer support Volta. neurobrix setup --branch pytorch automatically selects the validated cu126 build (torch==2.14.0+cu126) for Volta GPUs. The PyTorch engine uses torch==2.14.0 (the release it is validated with) and refuses any other version by name before any weight loads.

macOS (Metal). The Triton engine runs on a Mac's GPU through Metal. PyPI publishes no Triton for macOS: install-metal installs NeuroBrix's Triton build for Apple GPUs (NeuroBrix/triton-ext; upstream: triton-lang/triton-ext#126), each wheel checked against the sha256 written in nbxtensor. Wheels exist for macOS 14 or newer, CPython 3.10 to 3.13; install-metal picks the one for your macOS and Python:

pip install neurobrix
python -m nbxtensor install-metal
neurobrix doctor

Xcode's Metal toolchain is the other requirement. The PyTorch engine also runs on the Apple GPU, through MPS: pip install neurobrix then neurobrix setup --branch pytorch.

CPU only (the PyTorch engine). neurobrix setup --branch pytorch detects a CPU-only machine and installs the validated CPU build (torch==2.14.0+cpu from the PyTorch CPU index):

pip install neurobrix
neurobrix setup --branch pytorch

On the CPU of a machine that has an NVIDIA GPU. Hide the GPU from NeuroBrix with CUDA_VISIBLE_DEVICES=-1: the machine is then detected without a GPU and every model is planned on its CPU (the PyTorch engine, with any PyTorch build). The variable must be set in the shell that starts neurobrix run or neurobrix serve.

CUDA_VISIBLE_DEVICES=-1 neurobrix serve --model TinyLlama/TinyLlama-1.1B-Chat-v1.0    # Linux, macOS
set CUDA_VISIBLE_DEVICES=-1
neurobrix serve --model TinyLlama/TinyLlama-1.1B-Chat-v1.0

In PowerShell: $env:CUDA_VISIBLE_DEVICES = "-1", then the same command.

neurobrix doctor checks that the neurobrix command is on your PATH, whether the Triton engine can run (nbxtensor, Triton and a GPU runtime), which PyTorch build is installed if any, and whether it can see the GPUs your driver reports. It exits non-zero when neither engine can run.

First run

# Browse the hub and download a small language model
neurobrix hub --category LLM
neurobrix import TinyLlama/TinyLlama-1.1B-Chat-v1.0 --accept-license

# Run it once (no --hardware needed: the machine's profile is used)
neurobrix run --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 \
    --prompt "Write a Python function that reverses a string." --max-tokens 256

One name per model. A model is named by its hub name, <org>/<name> (its Hugging Face or vendor repository's). neurobrix import records that name beside the installed model, and --model (run, serve, upscale), remove, neurobrix list and the HTTP API all use it; there is no second, short name. A model installed before 0.6.3 keeps its directory name until neurobrix import <org>/<name> is run once for it (nothing is downloaded again), and list and every use say so in one line.

A run prints its result on stdout (the generated text, the transcript, or SAVED: <path> for a file) and a few status lines on stderr: the engine in use and the run time. On the first launch on a machine that has no hardware profile, NeuroBrix creates that profile once; every later launch reads it. A profile given with --hardware is read as it is. -v adds the engine's developer lines — the plan, the loaders, the kernel directory, the timings — -vv the full Python error detail of an error, and NBX_LOG=debug in the environment both.

Serve and chat

neurobrix serve keeps a model loaded in a background daemon between requests; chat talks to a language model through it, run uses it when it serves the same model, and stop unloads it:

neurobrix serve --model TinyLlama/TinyLlama-1.1B-Chat-v1.0
neurobrix chat                                # interactive multi-turn chat (/new, /context, /status, /quit)
neurobrix run --prompt "What is a KV cache?"  # --model can be omitted while a daemon is running
neurobrix stop                                # stop the daemon and free GPU memory

Whether the weights stay on the device between requests (warm) depends on the plan Prism chooses for the machine; neurobrix serve -v says which. Details: Serving and chat.

The conversation cache

The KV cache belongs to the chat session, on both engines. Each turn matches the conversation's token IDs against what the cache already holds and prefills only the new ones. Prism chooses the session's prefill chunk from the certified kernel times (--explain-plan says which, or why none); with that chunk, a turn served from the cache gives the same bytes as the same conversation prefilled together.

A conversation has a ceiling, stated when serve starts ("served context: up to N positions a session"): the positions the card's cache holds (session_reach in run --explain-plan) plus, past them, those the KV host tier's share of host memory holds, within the model's window. Before a turn would pass it, the conversation is compacted: its oldest turns are replaced by the model's own summary, the system prompt and the latest turns kept word for word, and the reply says so (chat prints one line; over HTTP the reply carries compaction). A max_tokens past what the prompt leaves is generated up to the end of the context (finish_reason: "length", and a note: over HTTP the header X-NeuroBrix-Note). Only a system prompt and a message that alone do not fit are refused (over HTTP: 400 context_length_exceeded). /context in chat shows the conversation's exact token count, the ceiling and the tokens the cache holds; /new starts again.

run --turns plays a JSON list of user messages as one session, through the same code the daemon runs, and prints each answer with the tokens its turn matched and prefilled:

echo '["Name three primary colours.", "Which of them is the warmest?"]' > turns.json
neurobrix run --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --turns turns.json --max-tokens 64

OpenAI-compatible API

neurobrix serve --http opens an HTTP server that speaks the OpenAI API on the same daemon: the same loaded model, the same queue and the same inference thread as chat and run, so they share the warm weights.

neurobrix serve --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --http      # http://127.0.0.1:8765/v1

The address is 127.0.0.1:8765 unless --http-host / --http-port say otherwise; an address other than loopback is refused without --api-key-file <file>, and every request then sends Authorization: Bearer <key>. The endpoints served are those the loaded model's family has: /v1/models, /v1/chat/completions (streamed as Server-Sent Events, tool calls parsed from the format the model's chat template declares, a thinking model's reasoning in reasoning_content), /v1/completions, /v1/images/generations, /v1/audio/speech and /v1/audio/transcriptions, and /v1/embeddings for an embedding family. The model field is the model's one name.

curl -s http://127.0.0.1:8765/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0",
  "messages": [{"role": "user", "content": "What is a KV cache?"}], "max_tokens": 128}'

With the OpenAI Python client (pip install openai on the client side; the engine does not need it):

from openai import OpenAI

client = OpenAI(base_url="http://127.0.0.1:8765/v1", api_key="unused")   # the key file's content when the server has one
model = client.models.list().data[0].id

for chunk in client.chat.completions.create(model=model, stream=True,
                                            messages=[{"role": "user", "content": "Tell me a story."}]):
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

A parameter the engine does not honour (logprobs, n > 1, ...) is refused by name in the OpenAI error object, never ignored. Every endpoint, parameter and setting: Serving and chat.


Hardware and modality coverage

Hardware

Hardware Status
NVIDIA GPUs, Linux (CUDA) Supported on both compute branches (Triton and PyTorch). Architecture profiles cover Volta, Turing (T4, RTX 20xx), Ampere (A100, RTX 30xx), Ada (L4, L40S, RTX 40xx), Hopper, and Blackwell (B200, RTX 50xx); custom profiles can also be supplied via --hardware.
CPU (x86-64) Supported (PyTorch engine).
Mac GPUs (Metal) Supported on both engines: the Triton engine through Metal (NeuroBrix's Triton build for Apple GPUs, installed by python -m nbxtensor install-metal), and the PyTorch engine on MPS. Install: Install and first run, macOS (Metal).
Intel GPUs Supported via the Triton engine on Intel GPUs with the Level Zero runtime (Arc, Core Ultra, and Gen12: Tiger, Alder, Raptor Lake) and Intel's Triton build (neurobrix doctor prints the install commands). If the driver declines a kernel or feature, the run reports the exact call and falls back cleanly without that device. Feedback: Intel GPU report.
AMD GPUs Supported via nbxtensor's HIP driver with the ROCm runtime and Triton build (neurobrix doctor prints the install commands). Feedback: open an issue.
Integrated GPUs Supported as a unified memory pool with the host. Mac GPUs run through Metal; Intel integrated GPUs (Gen12+) run through Level Zero.
Windows Supported. Defaults to the PyTorch engine (--compiled and --sequential). --triton is also supported when triton-windows>=3.5.0 is installed; otherwise --triton refuses by name with setup instructions. Install the Microsoft Visual C++ Redistributable (x64) for PyTorch.

Several GPUs in one machine are used automatically when a model does not fit on one. The first launch names each GPU from what the operating system ships (the PCI bus on Linux, Win32_VideoController on Windows), with its platform and whether it is integrated. When a run meets a device out-of-memory in one of its components, it records what that component needed, re-plans it and goes on, once, keeping the components already finished.

Platform notes:

  • pip install neurobrix followed by neurobrix setup (or neurobrix setup --branch pytorch) installs the validated torch==2.14.0 build for your OS, GPU, and driver (and refuses any other version by name before any weight loads); the Triton engine requires no torch.
  • Constrained decoding needs the grammar engine, the nbxgrammar package, which pip install neurobrix installs on Linux x86_64 and aarch64, macOS arm64 and x86_64 and Windows x86_64; on any other platform no wheel of it exists and a constrained request is refused by name (501 constrained_decoding_not_installed). It enforces a subset of JSON Schema (a constraining keyword outside it is refused by name) and writes tool calls in the format the model's template declares.
  • A very long single prompt on the compiled engine is prefilled in chunks of the rows the plan prices.
  • A daemon holds one model; a conversation past the card's cache spills to host memory one sequence at a time (batch 1).
  • The macOS 14 Metal wheels (CPython 3.10-3.13) are published at apple-v0.1.0+triton3.8.0-macos14 and python -m nbxtensor install-metal selects them (since nbxtensor 0.0.9).

The release notes say more. Read them before filing a bug.

Models on the hub

The hub lists 49 models. It is the live list (neurobrix hub, or neurobrix.org/models). Each identifier below is what you pass to neurobrix import, and then to --model.

Category Models
Language models (LLM) TinyLlama/TinyLlama-1.1B-Chat-v1.0, ibm-granite/granite-3.1-1b-a400m-instruct, deepseek-ai/deepseek-moe-16b-chat, Qwen/Qwen3-30B-A3B-Thinking-2507
Code (CODE) deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct, Qwen/Qwen3-Coder-30B-A3B-Instruct
Vision-language (VLM) zai-org/GLM-4.1V-9B-Thinking
Multimodal (MULTIMODAL) deepseek-ai/Janus-Pro-7B, inclusionAI/Ming-Lite-Omni-1.5, openbmb/MiniCPM-o-4_5, Qwen/Qwen3-Omni-30B-A3B-Instruct, Qwen/Qwen3-VL-30B-A3B-Thinking
Speech-to-text (STT) openai/whisper-large, openai/whisper-large-v3-turbo, nvidia/parakeet-tdt-1.1b
Speech understanding (AUDIO_LLM) mistralai/Voxtral-Mini-3B-2507, nvidia/canary-qwen-2.5b, ibm-granite/granite-speech-3.3-8b
Text-to-speech (TTS) hexgrad/Kokoro-82M, ResembleAI/chatterbox, microsoft/VibeVoice-1.5B, canopylabs/orpheus-3b-0.1-ft, fishaudio/s1-mini
Image generation (IMAGE) ostris/Flex.1-alpha, PixArt-alpha/PixArt-XL-2-1024-MS, PixArt-alpha/PixArt-Sigma-XL-2-1024-MS, Efficient-Large-Model/Sana_1600M_1024px_MultiLing_diffusers, Efficient-Large-Model/Sana_1600M_4Kpx_BF16_diffusers
Video generation (VIDEO) zai-org/CogVideoX-2b, zai-org/CogVideoX-5b-I2V, genmo/mochi-1-preview, hpcai-tech/Open-Sora-v2, rhymes-ai/Allegro, rhymes-ai/Allegro-TI2V, Efficient-Large-Model/SANA-Video_2B_720p_diffusers, Wan-AI/Wan2.1-T2V-1.3B-Diffusers, Wan-AI/Wan2.1-VACE-1.3B-diffusers, Wan-AI/Wan2.1-I2V-14B-480P-Diffusers, Wan-AI/Wan2.2-I2V-A14B-Diffusers
Upscaling (UPSCALER) Real-ESRGAN (x2, x4plus, x8), SwinIR (classical x2, x4), Swin2SR (classical x2, x4, real-world x4), HAT (L x4, S x4)

Every model on the hub is packaged as a .nbx container ready for neurobrix import. Prism computes placement for your hardware. When a model is larger than your GPU memory, Prism plans a slower placement (offload or streaming through host memory), states the estimate, and asks before it runs.


Usage by family

The family is read from the container, so run takes the inputs that family needs. Every command and flag: the CLI reference (neurobrix run --help prints the same).

# Language model
neurobrix run --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --prompt "Explain recursion." \
    --temperature 0.7 --max-tokens 512 --output answer.txt

# Speech-to-text: audio in, text out
neurobrix run --model openai/whisper-large-v3-turbo --audio recording.wav

# Speech understanding: audio plus an instruction
neurobrix run --model mistralai/Voxtral-Mini-3B-2507 --audio meeting.wav \
    --prompt "Summarize this call."

# Text-to-speech
neurobrix run --model hexgrad/Kokoro-82M --prompt "Hello from NeuroBrix." --speaker af_heart --output speech.wav

# Vision-language: image plus a question
neurobrix run --model zai-org/GLM-4.1V-9B-Thinking --input-image photo.jpg \
    --prompt "What is in this image?"

# Multimodal models take --mode: the mode their container was built for (Janus-Pro-7B's build: image)
neurobrix run --model deepseek-ai/Janus-Pro-7B --mode image --prompt "a red apple on a wooden table"

# Image generation
neurobrix run --model ostris/Flex.1-alpha --prompt "a lighthouse at dusk" \
    --steps 20 --seed 42 --output lighthouse.png

# Video generation; --input-image switches an image-to-video model to its first frame
neurobrix run --model zai-org/CogVideoX-2b --prompt "a hot air balloon over mountains" \
    --num-frames 17 --seed 42 --output balloon.mp4

# Upscaling
neurobrix upscale --model xinntao/Real-ESRGAN-RealESRGAN_x4plus --input photo.png --output photo_x4.png

Execution modes

Flag Branch Use
--compiled PyTorch Normal use; the default where PyTorch is installed.
--triton Triton nbxtensor's Triton kernels instead of PyTorch's operator library; the default where PyTorch is not installed.
--sequential PyTorch, one operation at a time Debugging.
--triton-sequential Triton, one operation at a time Debugging.

The same flags apply to neurobrix serve and neurobrix upscale; upscale also takes them as --mode compiled|sequential|triton|triton-sequential. With no flag, each command takes the PyTorch engine where PyTorch is installed and the Triton engine where it is not.

Managing models

neurobrix hub [--category CATEGORY] [--search TERM]   # browse the hub
neurobrix import <org>/<name> [--no-keep] [--force]   # download and install
neurobrix list [--store]                              # installed models by name / downloaded archives
neurobrix remove <org>/<name> [--all]                 # remove from the cache (and the store)
neurobrix clean --all -y                              # remove everything
neurobrix info --models --hardware --system           # what is installed and detected
neurobrix inspect <name or model.nbx>                 # look inside a container
neurobrix validate <model.nbx>                        # check a container's integrity

Downloaded archives are kept in ~/.neurobrix/store/ and extracted models in ~/.neurobrix/cache/. --no-keep deletes the archive once it is extracted. import --container FILE.nbx installs from a container already on the machine, checked against the sha256 the hub serves. Read commands (info, list, hub, inspect, doctor, run --explain-plan) accept --json for scripting; so do import (one event per phase) and remove.

A model may declare sub-components (a text front end, for one). They are downloaded once, at its first run, and checked against the checksum its container states. neurobrix processor fetch <model> [--to FOLDER], neurobrix processor install <file> [--for <model>] and neurobrix processor list do it ahead of time, for example to carry them to an offline machine.

Certify your GPU and share it

nbxtensor's kernel settings, which the Triton engine runs, are certified per launch key (the kernel, its shape class and dtypes) and per GPU class, against a float64 oracle, and shipped. A key your GPU class has no certificate for is swept at run time and kept on your machine; certifying it makes it permanent, and sharing it means nobody with your GPU sweeps it again. The four steps, with the commands, are in nbxtensor's README, Certify your own hardware:

  1. Run the models you use with --triton; the keys no certificate covers are swept and kept in ~/.neurobrix/replay_cache/.
  2. Certify them: neurobrix autotune certify --profile <your device file> --keys <the kept keys> --out ./my-certificates.
  3. Check that they are served: the same run with NEUROBRIX_AUTOTUNE_CERTIFIED_DIR=./my-certificates and --certified-only says 0 swept at runtime and gives the same output.
  4. Share them: add the files under src/neurobrix/config/autotune/<vendor>/<profile>/ and open a pull request with the certificate template (?template=certificate.md): your GPU, driver, the commands and the output of step 3.

Certified your GPU? Share your certificates — every class certified is a class nobody autotunes again.


The .nbx container

A container is a directory archive with a manifest, a topology describing how components connect, runtime defaults, and one directory per component (text encoder, transformer, VAE, language-model head, and so on), each with its computation graph and its weights in safetensors format. Tokenizers and other non-neural modules travel in the same archive; a model may also declare sub-components that are downloaded once and checked against the container's checksum (see Managing models). The format is described in docs/architecture/nbx-format.md.


Contributing

Bug reports, model requests, hardware reports and code are welcome. Read CONTRIBUTING.md first; it covers the development setup, the engine's design rules (no hard-coded model values, no silent fallbacks, no model-specific logic in the runtime) and the review process. Security issues follow SECURITY.md and are not filed as public issues.


Model licenses

NeuroBrix runs models; it does not create, train or own them. Every model on the hub is the work of its authors and stays under its original license, which the hub shows and which neurobrix import asks you to accept. Some are restricted: for example fishaudio/s1-mini is licensed CC-BY-NC-SA-4.0 (non-commercial use only). You are responsible for using each model within its license. The hub's packages contain the original published weights repackaged in the .nbx format. If you are a model author and believe a package does not respect your license, open an issue on this repository.

License

The NeuroBrix engine, CLI, runtime and container tooling are released under the Apache License 2.0. The license does not cover model weights.

© 2025–2026 Hocine Benkelaya. NeuroBrix engine released under the Apache License 2.0.

Developed by Hocine Benkelaya · Supported and funded by Neural Network Holding Ltd · Commercial distribution by WizWorks OÜ.

Explorer des projets similaires

Chargement…