Skip to main content

B4N1 Boost — More speed. More power. Greater potential.

📦 b4n1-boost

The polyglot accelerator. One native core, seven SDKs — Python, Node.js, Ruby, PHP, Java, .NET and Go. JSON 3-5x faster, compression ~21x faster (measured), response cache, bloom filter and circuit breaker in every core SDK.

License Docs PyPI Python versions PyPI downloads Pepy downloads npm npm downloads NuGet NuGet downloads Maven Central RubyGems Packagist Go Reference Tests

📚 Full manual (installation, middleware, accelerators, performance): https://b4n1-com.github.io/b4n1-boost/

🖥 Platform Support

Platform Architectures
Linux x86_64, aarch64
macOS x86_64, arm64 (Apple Silicon)
Windows x86_64

Pre-compiled binaries for every platform and every language — no compiler required, works out of the box.


📦 Installation — 7 registries, 1 core

Registry Language Package Command
PyPI Python 3.10+ b4n1-boost pip install b4n1-boost
npm Node.js b4n1-boost npm install b4n1-boost
NuGet .NET / C# B4N1.Boost dotnet add package B4N1.Boost
Maven Java / Kotlin com.b4n1:boost implementation 'com.b4n1:boost:0.6.1'
RubyGems Ruby / Rack b4n1-boost gem install b4n1-boost
Packagist PHP / Laravel b4n1/boost composer require b4n1/boost
Go Go 1.23+ b4n1-boost/sdks/go go get github.com/B4N1-com/b4n1-boost/sdks/go

All seven packages ship the same native core (pre-compiled, no compiler needed). The Python wheel additionally bundles the HTTP middleware suite, and the Ruby/PHP/Go packages bundle the native lib for their platform.


Languages: العربية · Deutsch · Español · Français · हिन्दी · Italiano · 日本語 · 한국어 · Português (BR) · Русский · 中文

🧩 What each SDK gives you

Capability Python Node.js Java / Kotlin .NET Ruby PHP Go
Response cache (LRU + TTL) ✅ ✅ ✅ ✅ ✅ ✅ ✅
Bloom filter — ✅ ✅ ✅ ✅ ✅ ✅
Circuit breaker ✅ ✅ ✅ ✅ ✅ ✅ ✅
Gzip / Zstd compression ✅ ✅ ✅ ✅ ✅ ✅ ✅
HTML minification ✅ ✅ ✅ ✅ ✅ ✅ ✅
JSON validation ✅ ✅ ✅ ✅ ✅ ✅ ✅
HTTP middleware (compression, ETag, CORS, rate limit, security headers, decompression, health check) ✅ Express — ASP.NET Rack Laravel —
Zstd decompression ✅ ✅ ✅ ✅ ✅ ✅ ✅
Background tasks (no Redis, no Celery) ✅ ✅ ✅ ✅ — — —
Brotli compression ✅ — — — — — —
Minification (CSS / JS) + HTML→Markdown ✅ — — — — — —
JWT validation ✅ — — — — — —
JSON engine 3.1-5.0x faster ✅ — — — — — —
Django ORM / DRF / SQLAlchemy accelerators ✅ — — — — — —

The compression + minification + JSON core is the same native call in all seven languages (one C-ABI, contract-tested per language). The cache, bloom filter, circuit breaker and zstd decompression are contract-tested in every SDK, Ruby, PHP and Go included — same core, same observably-tested behaviour.


⚡ Performance at a Glance

Component Metric vs stdlib
JSON dumps (native engine) 3.1-5.0x faster than stdlib json Python surface, measured 2026-10-21
Gzip (native) ~1.0x vs stdlib gzip level 6 1MB payloads (the native gzip is level 4)
Zstd (native) ~21x faster (level 1 vs gzip 4) 1MB payloads
Brotli (native) Best ratio, ~1.6x SLOWER than gzip 1MB payloads
DRF serializer not measured yet queryset → JSON
Django ORM PostgreSQL COPY bulk insert native
Wheel size ~1.4MB native, no compiler needed
No-GIL ready Python 3.13+ Free-threading support
Tests 1253 passing Rust 346 (lib + bin) + Python 907, plus the SDK contract suite ×7

🚀 Quick Start

Try it in one command (offline, no setup)

pip install b4n1-boost
b4n1-boost demo          # live numbers from the engine, on your machine
b4n1-boost docs --list   # the manual, bundled inside the binary

b4n1-boost demo runs the engine's own benchmark where it is executed and prints what it just measured — no stored figures, no projections, no network. The historical per-framework multipliers are printed as estimates, labelled as such.

Prefer a file you can hand over? bash scripts/build-demo-bundle.sh (or bash cli.sh boost bundle from the framework root) builds a self-contained ZIP with the pitch, the full manual, the binary and a one-command demo.sh.

The shared core (Python, Node.js, Java, .NET)

Response cache, bloom filter and circuit breaker — the same native primitives in these four SDKs. Contract-tested in all four.

Node.js

const { ResponseCache, BloomFilter, CircuitBreaker } = require('b4n1-boost/core.js');

const cache = new ResponseCache(1024);                       // capacity
cache.set('user:1', JSON.stringify({ id: 1 }), 200, 60);    // key, body, status, ttl (s)

const seen = new BloomFilter(100_000, 0.01);                // expected items, fp rate
if (!seen.checkAndSet('already-processed')) { /* first time we see it */ }

const breaker = new CircuitBreaker(5, 2, 30);               // threshold, successes, timeout (s)
if (!breaker.allows()) return fallback();

.NET

using B4N1.Boost;

using var cache = new NativeResponseCache(1024);
cache.Set("user:1", Encoding.UTF8.GetBytes("{\"id\":1}"), 200, 60);

using var seen = new NativeBloomFilter(100_000, 0.01);
bool firstTime = !seen.CheckAndSet("already-processed");

var breaker = new NativeCircuitBreaker(5, 2, 30);
if (!breaker.Allows) return Fallback();

Java / Kotlin

import com.b4n1.boost.NativeResponseCache;

try (NativeResponseCache cache = new NativeResponseCache(8)) {
    cache.set("user:1", "{\"id\":1}".getBytes(StandardCharsets.UTF_8), 200, 60_000);
}

Python

from b4n1_boost import ResponseCache

cache = ResponseCache(1024, 60)                   # capacity, default TTL (s)
cache.set("user:1", b'{"id":1}', [], 200)         # key, body, headers, status

Compression engine

Node.js

const boost = require('b4n1-boost');

const zstd = boost.compressZstd(payload);      // ~21x faster than gzip level 4 (1MB)
const back = boost.decompressZstd(zstd);
const min  = boost.minifyHtml(html);

.NET

var zstd = NativeBoost.CompressZstd(payload);

Java / Kotlin

byte[] zstd = Boost.compressZstd(data, 3);

Ruby

require 'boost'

zstd = B4N1::Boost.compress_zstd(payload)
min  = B4N1::Boost.minify_html(html)
ok   = B4N1::Boost.json_valid?(body)

PHP

use B4N1\Boost;

$zstd = Boost::compressZstd($payload);
$min  = Boost::minifyHtml($html);
$ok   = Boost::isJsonValid($body);

Go

import boost "github.com/B4N1-com/b4n1-boost/sdks/go"

zstd, _ := boost.CompressZstd(payload, 3)
min := boost.MinifyHTML(html)
ok := boost.IsJSONValid(body)

Express / ASP.NET middleware

const express = require('express');
const boostMiddleware = require('b4n1-boost/express');

app.use(boostMiddleware({ minifyHtml: true, gzipLevel: 4 }));

📚 Full usage for every language lives in the manual.


🐍 Python suite (middleware + accelerators)

The Python package is the most complete one: everything above, plus the HTTP middleware suite and the framework accelerators.

pip install b4n1-boost

Precompiled native wheels for Linux (x86_64 + aarch64), macOS (x86_64 + Apple Silicon), and Windows (x86_64). No compiler required.

Supported Python versions: 3.10, 3.11, 3.12, 3.13

Django

import b4n1_boost
report = b4n1_boost.install_django()
# Appends DjangoBoostMiddleware to settings.MIDDLEWARE
# Report shows: {'framework': 'Django', 'middleware_installed': True, ...}

FastAPI

from fastapi import FastAPI
import b4n1_boost

app = FastAPI()
b4n1_boost.install_fastapi(app)

Flask

from flask import Flask
import b4n1_boost

app = Flask(__name__)
b4n1_boost.install_flask(app)

Auto-detection

import b4n1_boost
b4n1_boost.autoboost()  # Detects Django/FastAPI/Flask automatically

One-line install all middleware

import b4n1_boost
report = b4n1_boost.boost_all()
# Applies: compression + ETag + security headers + CORS + rate limiting + health check
# Returns: {'framework': 'Django', 'applied': ['compression', 'etag', ...], 'middleware_count': 6}

🔧 Features

JSON Serialization (3.1-5.0x faster than stdlib json)

from b4n1_boost import NativeJson, canonicalize_json, validate_json

# Fast JSON dumps (native engine, 3.1-5.0x faster than stdlib `json`)
result = NativeJson.dumps({"users": [...]})

# Direct native path (no intermediate conversion)
result = NativeJson.dumps_direct(data)

# Batch: serialize N objects in a single GIL acquire
results = NativeJson.batch_dumps([obj1, obj2, obj3])

# Canonicalize: sorted keys, compact form (accepts str or dict)
canonicalize_json({"z": 1, "a": 2})  # '{"a":2,"z":1}'

# Fast JSON validation
validate_json('{"valid": true}')  # True

Compression (~21x faster than gzip level 4, GIL-free)

from b4n1_boost import py_compress_zstd, py_compress_gzip, py_compress_brotli

compressed = py_compress_zstd(payload)   # ~21x faster than gzip level 4 (1MB)
compressed = py_compress_brotli(payload) # Best ratio (slower than gzip)
compressed = py_compress_gzip(payload)   # ~1.0x vs stdlib gzip level 6

# Static file compression
from b4n1_boost import compress_static_file, compress_static_dir
compress_static_file("app/static/app.js", algorithm="zstd")
compress_static_dir("app/static/", algorithm="zstd")

Content-Type Aware Middleware

from b4n1_boost.middleware import B4N1BoostCompressionMiddleware

# Automatically skips: images, video, audio, fonts, archives, already-compressed
app.wsgi_app = B4N1BoostCompressionMiddleware(app.wsgi_app, min_size=1024)

# For FastAPI/ASGI (streaming support)
from b4n1_boost.middleware import FastAPIBoostCompressionMiddleware
app.add_middleware(FastAPIBoostCompressionMiddleware)

ETag / 304 Caching

from b4n1_boost.middleware import ETagMiddleware
app.wsgi_app = ETagMiddleware(app.wsgi_app)

Rate Limiting

from b4n1_boost.middleware import RateLimitMiddleware
app.wsgi_app = RateLimitMiddleware(app.wsgi_app, max_requests=100, window_seconds=60)

Security Headers

from b4n1_boost.middleware import SecurityHeadersMiddleware
app.wsgi_app = SecurityHeadersMiddleware(app.wsgi_app)
# Adds: X-Content-Type-Options, X-Frame-Options, HSTS, X-XSS-Protection, etc.

CORS

from b4n1_boost.middleware import CORSMiddleware
app.wsgi_app = CORSMiddleware(app.wsgi_app, allow_origins=["https://example.com"])

Health Check

from b4n1_boost.middleware import HealthCheckMiddleware
app.wsgi_app = HealthCheckMiddleware(app.wsgi_app, path="/health")
# GET /health → 200 {"status": "ok"}

WebSocket Compression (RFC 7692 permessage-deflate)

from b4n1_boost import WebSocketCompressionMiddleware

# ASGI (FastAPI / Starlette): wrap the app
app = WebSocketCompressionMiddleware(app, enabled=True)

Compresses text and binary frames above a threshold, only when the client offers permessage-deflate. Honours server_max_window_bits and server_no_context_takeover; never compresses control frames (close/ping/pong) and never touches small frames. If compression fails, the message is delivered raw rather than dropped. Toggle with B4N1_BOOST_WS=false.

Metrics (Prometheus / OpenTelemetry)

from b4n1_boost import MetricsExporter
from b4n1_boost.middleware import metrics

exporter = MetricsExporter(metrics)          # or MetricsExporter(metrics, "otel")
app.wsgi_app = exporter.wsgi_app(environ)    # mount at /metrics
# ASGI: app.mount("/metrics", exporter.asgi_app)

GET /metrics returns the Prometheus text format; GET /metrics?format=otel returns a JSON snapshot. Exposes total_compressions, total_bytes_in, total_bytes_out, compression_ratio, space_saved_pct and compressions_by_algorithm{algorithm=...}. The label set is closed — an unexpected algorithm folds into other, so traffic cannot grow the series count.

Cache Layer

from b4n1_boost.advanced import ResponseCache

cache = ResponseCache(capacity=1000, default_ttl=300)
cache.set("/users", b'{"ok":true}', [], 200)
body, headers, status = cache.get("/users")

Django ORM Accelerator

from b4n1_boost.django_accelerator import bulk_insert_native, FastModelMixin

# PostgreSQL COPY — native bulk insert (speed not measured yet)
bulk_insert_native(MyModel, [
    {"name": "Alice", "email": "alice@example.com"},
    {"name": "Bob", "email": "bob@example.com"},
])

DRF Serializer Accelerator

from b4n1_boost.drf_accelerator import fast_serialize, FastSerializerMixin

# queryset → JSON without DRF overhead (speed not measured yet)
json_bytes = fast_serialize(queryset, fields=["id", "name", "email"])

# Mixin for existing serializers
class MySerializer(FastSerializerMixin, serializers.ModelSerializer):
    class Meta:
        model = MyModel
        fields = ["id", "name"]

JWT Validation

from b4n1_boost.advanced import validate_jwt

# Native HMAC-SHA256 (no PyJWT dependency required)
payload = validate_jwt(token, secret="my-secret", algorithm="HS256")

HTML/CSS/JS Minification

from b4n1_boost.advanced import minify_html, minify_css, minify_js

minified = minify_html("<html>  <body>  Hello  </body>  </html>")

HTML → Markdown (Agentic)

from b4n1_boost import html_to_markdown

markdown = html_to_markdown("<h1>Title</h1><p>Content with <b>bold</b></p>")
# → "# Title\n\nContent with **bold**"

Telemetry

from b4n1_boost import (
    telemetry_init,
    telemetry_capture_error,
    telemetry_log_info,
    telemetry_log_phase,
    telemetry_flush,
)

telemetry_init(app="b4n1-boost")
telemetry_capture_error("something failed", {"user": "123"})
telemetry_log_info("Request processed", {"phase": "http"})
telemetry_log_phase("http", "ok", 12)
telemetry_flush()

Background Worker (zero-GIL)

from b4n1_boost import (
    worker_compress,
    worker_decompress,
    worker_minify,
    worker_jwt_validate,
)

# Heavy ops offloaded to the background worker — the caller does not hold
# the GIL while they run
compressed = worker_compress(data, "zstd")
restored = worker_decompress(compressed)
markup = worker_minify(html, "html")
claims = worker_jwt_validate(token, secret)

🔍 Status & Diagnostics

import b4n1_boost
print(b4n1_boost.status())
# {'version': '0.6.1', 'native_extension': True, 'features': [...]}
# Run hardware benchmarks
report = b4n1_boost.run_benchmarks(iterations=100_000)
# Generate fresh HTML status report
# python3 generate_report.py --open


📄 License

Business Source License 1.1 (BUSL-1.1) — note this is not the SPDX id BSL-1.1, which denotes the Boost Software License.

  • Free for development, evaluation, testing, personal projects, and startups under $100K USD annual revenue.
  • Commercial license required for organizations >= $100K USD, government agencies, and public bidding.
  • After Change Date (4 years) → Apache License 2.0.

See LICENSE for full text.


b4n1-boost: The polyglot accelerator. One native core, seven SDKs. JSON 3-5x faster. Compression ~21x faster than gzip level 4. Middleware transparent. Built with ❤️ by B4N1.

Metadata

Release files for b4n1-boost 0.6.1

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 b4n1-boost 0.6.1
File Actions
b4n1_boost-0.6.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for b4n1_boost-0.6.1-cp310-abi3-win_amd64.whl
b4n1_boost-0.6.1-cp310-abi3-manylinux_2_34_x86_64.whl CPython 3.10 abi3 Linux glibc 2.34+ x86-64 Details for b4n1_boost-0.6.1-cp310-abi3-manylinux_2_34_x86_64.whl
b4n1_boost-0.6.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for b4n1_boost-0.6.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
b4n1_boost-0.6.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for b4n1_boost-0.6.1-cp310-abi3-macosx_11_0_arm64.whl
b4n1_boost-0.6.1-cp310-abi3-macosx_10_13_x86_64.whl CPython 3.10 abi3 macOS 10.13+ x86-64 Details for b4n1_boost-0.6.1-cp310-abi3-macosx_10_13_x86_64.whl

Total release size: 12.8 MB

Release files / b4n1_boost-0.6.1-cp310-abi3-win_amd64.whl

Download URL b4n1_boost-0.6.1-cp310-abi3-win_amd64.whl
Size 3.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
cfd0f938056a69bb9e5bbb88c17a3eb2a581a42955c270b1d9376e9302ac702d
BLAKE2b-256 checksum
How to use checksums
ac694a3cf22c5cc3b1d5023adde3a6d72f54ba97c04a6bb4a629b08bbb4db7f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / b4n1_boost-0.6.1-cp310-abi3-manylinux_2_34_x86_64.whl

Download URL b4n1_boost-0.6.1-cp310-abi3-manylinux_2_34_x86_64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
b9c37975385585d552a4b066348033ae3a614de2202c5a7c069dab92bfec0b12
BLAKE2b-256 checksum
How to use checksums
5f3d57530e6a834985a7fb159fe7081e4c689326bbbff954e3548261c938e290
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / b4n1_boost-0.6.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL b4n1_boost-0.6.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6687965fad0dc2de7a117ea349d1f3f03183646a959c24b0ac583212ebcd7884
BLAKE2b-256 checksum
How to use checksums
b67da9b50d5fafa9551bf234b161f5b857d64b43c90c174c2e62e490fbb52b10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / b4n1_boost-0.6.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL b4n1_boost-0.6.1-cp310-abi3-macosx_11_0_arm64.whl
Size 2.3 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
365e83bd8795d9005b49b6cc7427e3d47f5196d08d79456e09f4970fe816049d
BLAKE2b-256 checksum
How to use checksums
b1dfb25e64a6086fc46183dcce5b861e2990bd4378a57fc0ada00964516d6074
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / b4n1_boost-0.6.1-cp310-abi3-macosx_10_13_x86_64.whl

Download URL b4n1_boost-0.6.1-cp310-abi3-macosx_10_13_x86_64.whl
Size 2.4 MB
Tags CPython 3.10 abi3 macOS 10.13+ x86-64
SHA-256 checksum
How to use checksums
486efa171ae854d5aba2b42d5f71360527f8d8c53b5d4a9aea964dcc7f27ff9d
BLAKE2b-256 checksum
How to use checksums
764133c1b96475ad0b35476e6b12de83019c5cd4543eed2e05e713dc47ce05ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for b4n1-boost 0.6.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.6.1 This release

5 release files No 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