Skip to content
CAI
Software that uses CAICheck a score

emmett-framework/granian

68.2

Adequate · 14 November 2026

12.2k

lines of production code

Rust

with Python

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add Granian benchmark suite and results

The benchmarks directory now includes a comprehensive suite for evaluating Granian's performance, featuring a Python harness (benchmarks.py) and shell scripts to run tests against multiple Python versions (3.10–3.14) and third-party servers like Uvicorn, Gunicorn, and Hypercorn. The suite covers HTTP/1 and HTTP/2, ASGI, RSGI, and WSGI interfaces, as well as WebSockets, concurrency, and file responses. Initial benchmark results are provided in Markdown files (README.md, vs.md, concurrency.md, pyver.md, asyncio.md) showing Granian's throughput and latency metrics on an AMD Ryzen 7 5700X.

benchmarks · high confidence

Add WSGI protocol support

The server now supports the WSGI interface, allowing Python applications that implement the WSGI specification to be served. This change introduces a new \WSGIWorker\ class and the underlying Rust implementation in \src/wsgi\ to handle request processing, including building the WSGI environment dictionary, managing request bodies via an iterator interface, and handling response streaming and iteration.

src/wsgi · high confidence

Add WebSocket benchmark suite

A new WebSocket benchmark suite has been added to the \benchmarks/ws\ directory, providing tools to measure performance for both ASGI and RSGI implementations. The suite includes application entry points (\asgi.py\, \rsgi.py\) that handle WebSocket connections and broadcasting, alongside a \benchmark.py\ script that orchestrates concurrent clients to measure send/receive timings and throughput using \time.perf\_counter\.

benchmarks/ws · high confidence

Add benchmark applications for ASGI, RSGI, and WSGI protocols

The benchmarks suite now includes dedicated application files for ASGI, RSGI, and WSGI protocols, enabling performance testing across these different interfaces. These applications provide a consistent set of routes for testing various scenarios, including static responses of different sizes (10 bytes to 100KB), echo endpoints, file serving, and simulated I/O delays.

benchmarks/app · high confidence

Added proxy header handling utilities for ASGI and WSGI apps

New utilities in \granian/utils/proxies.py\ allow the server to correctly interpret \X-Forwarded-For\ and \X-Forwarded-Proto\ headers when requests come from trusted hosts. This enables accurate client IP detection and scheme resolution (HTTP/HTTPS) behind reverse proxies, with support for configuring trusted hosts via IP addresses, CIDR networks, or wildcards.

granian/utils · high confidence

Granian 2.0 initial release with ASGI, RSGI, and WSGI support

Granian is released as version 2.0, introducing a Python web server that supports ASGI, RSGI, and WSGI application interfaces. The package exposes a \Server\ class for programmatic use and a CLI built with Click for command-line invocation. Key features include configurable event loops (asyncio, uvloop, winloop, rloop), access logging, static file serving, and SSL/TLS support.

granian · high confidence

Initial ASGI protocol support

The ASGI protocol is now available, allowing Python ASGI applications to be served. This implementation includes HTTP and WebSocket handling, with support for ASGI spec version 3.0 (spec 2.3), pathsend extensions, and WebSocket subprotocol negotiation. The ASGI worker exposes configuration options for HTTP/1 and HTTP/2 modes, SSL/TLS settings, static file serving, and backpressure management.

src/asgi · high confidence

Initial release of Granian, a Rust-based HTTP server for Python

Granian is now available as a Rust HTTP server for Python applications, supporting ASGI, WSGI, and the new RSGI interfaces. It features HTTP/1 and HTTP/2 protocols, HTTPS/mTLS, WebSockets, and static file serving. The server is built on Hyper and Tokio, offering high performance and concurrency. This release includes a comprehensive CLI with options for workers, runtime mode, event loop selection, and various tuning parameters. Documentation, contributing guidelines, and development tooling (Makefile, pre-commit hooks, linters) are also included.

(repo-wide) · high confidence

Introduce RSGI protocol implementation

Adds the RSGI (Rust Server Gateway Interface) protocol support, providing a new set of Python-exposed classes including RSGIHTTPProtocol, RSGIWebsocketProtocol, RSGIHeaders, and scope types (RSGIHTTPScope, RSGIWebsocketScope). This enables Python applications to handle HTTP and WebSocket requests via the RSGI interface, with dedicated workers and serving modes (multi-threaded, single-threaded, async) exposed through the RSGIWorker class.

src/rsgi · high confidence

Introduce embedded server API for in-process hosting

The \granian.server\ package now exposes an \embed\ module containing an \AsyncWorker\ and a \Server\ class, allowing Granian to be run as an embedded component within an existing Python application rather than only as a standalone process. This new API supports the same configuration options as the main server (such as SSL, static files, and interface selection) but manages the event loop and worker lifecycle internally via asyncio, enabling integration into frameworks or long-running services that require Granian's HTTP handling without external process management.

granian/server · high confidence

Introduce granian 2.0 with free-threaded Python support and new internal architecture

This release introduces granian 2.0, featuring support for free-threaded Python (PEP 703) via the \Py\_GIL\_DISABLED\ build flag, allowing the server to operate without holding the GIL. The internal architecture has been significantly refactored: the codebase is reorganized into distinct modules (asyncio, blocking, callbacks, conversion, files, http, ipc, metrics, net, runtime, serve, sys, tls, workers, ws, wsgi) to improve maintainability. A new metrics system has been added, exposing worker and server statistics via a dedicated exporter. The server now supports static file serving with configurable cache headers and directory listings. Additionally, the runtime includes a configurable blocking thread pool with idle timeout and growth strategies, and IPC mechanisms have been introduced for metrics collection in multi-threaded modes. The version has been bumped to 2.0.

src · high confidence

New benchmark report templates for Granian performance comparisons

The benchmark suite now includes a comprehensive set of Jinja2 templates that generate structured Markdown reports for Granian performance data. These templates cover multiple comparison dimensions: main protocol benchmarks (RSGI, ASGI, WSGI, HTTP/2, file responses), concurrency analysis (workers and runtime threads), AsyncIO-specific metrics (event loops and task implementations), Python version comparisons (3.10–3.14), and third-party server comparisons (ASGI, WSGI, HTTP/2, file responses, long I/O, and WebSockets). The templates standardize how benchmark results are presented, including helper functions for formatting latency and identifying maximum concurrency runs.

benchmarks/templates · high confidence

Test coverage

Add test application fixtures for ASGI, RSGI, and WSGI protocols; Initial test suite for Granian server protocols and features; Updated test fixtures for TLS and static content.

Dependencies

Initial release of Granian 2.8.4

This change introduces the initial dependency manifests for Granian version 2.8.4, establishing the project's build and runtime requirements. The Rust core relies on PyO3 0.29 for Python bindings, Hyper 1.11 for HTTP handling, and Tokio 1.51 for async runtime support, with optional memory allocators for jemalloc and mimalloc. The Python package requires Python 3.10+ and uses Click 8.1.0+ for its CLI, while optional extras provide support for environment variables (python-dotenv), process naming (setproctitle), file watching (watchfiles), and various event loop implementations including uvloop, rloop, and winloop.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 69 → 68 (-0.5)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 85 → 91 (+5.9)
  • Architecture 90 → 99 (+8.9)
  • Maturity 59 → 59 (+0.1)
  • Readiness 68 → 67 (-0.8)
  • Security 83 → 76 (-6.9)
  • Performance 89 → 89 (+0.0)

Resolved (9)

  • Duplicated block (5 lines × 2) (src/asgi/io.rs)
  • Duplicated block (9 lines × 3) (src/blocking.rs)
  • Hotspot: src/asgi/io.rs (src/asgi/io.rs)
  • Medium CVE: RUSTSEC-2026-0382 (Cargo.lock)
  • Medium vulnerability: RUSTSEC-2026-0385 (Cargo.lock)
  • Members sharing a duplicated core (8 members, 50+ identical tokens) (granian/server/mp.py)
  • No ADRs found
  • Outdated: tokio
  • Projects may be oversized for their cohesion

New (38)

  • Duplicated block (12–13 lines × 2) (src/asgi/http.rs)
  • Duplicated block (19 lines × 3) (src/blocking.rs)
  • Duplicated block (4–6 lines × 3) (src/serve.rs)
  • Duplicated block (7 lines × 2) (src/asgi/io.rs)
  • Duplicated block (7–8 lines × 4) (src/blocking.rs)
  • Duplicated block (9 lines × 2) (src/blocking.rs)
  • Duplicated block (9 lines × 2) (src/serve.rs)
  • Duplicated block (9–10 lines × 2) (src/blocking.rs)
  • Duplicated block (9–11 lines × 2) (src/wsgi/types.rs)
  • Edited copy of a member (10 corresponding lines) (src/asgi/callbacks.rs)
  • Edited copy of a member (10 corresponding lines) (src/asgi/callbacks.rs)
  • Edited copy of a member (10 corresponding lines) (src/blocking.rs)
  • Edited copy of a member (11 corresponding lines) (src/callbacks.rs)
  • Edited copy of a member (12 corresponding lines) (src/asgi/callbacks.rs)
  • Edited copy of a member (12 corresponding lines) (src/blocking.rs)
  • Edited copy of a member (12 corresponding lines) (src/http.rs)
  • Edited copy of a member (12 corresponding lines) (src/runtime.rs)
  • Edited copy of a member (13 corresponding lines) (src/asgi/callbacks.rs)
  • Edited copy of a member (16 corresponding lines) (src/rsgi/io.rs)
  • Edited copy of a member (18 corresponding lines) (src/blocking.rs)
  • …and 18 more

Changes since last survey

  • 22 commits — 19 feature/other, 3 fixes

By area

  • (root) — 8 commits
  • .github/workflows — 5 commits
  • src/wsgi — 3 commits
  • src/asgi — 2 commits
  • src/rsgi — 2 commits
  • granian/server — 1 commit
  • src/ws.rs — 1 commit

Notable commits

  • fix: Fix RSGI default status code on ws proto close
  • fix: Fix ws UpgradeData headers build
  • fix: ci: fix maturin action args
  • change: Add a 500ms accept delay on EMFILE/ENFILE
  • change: Always drop incoming body in ASGI and RSGI protocols
  • change: Avoid panics in rsgi RSGIHTTPProtocol.anext
  • change: Bump actions/download-artifact from 8.0.1 to 8.0.2 (#963)
  • change: Bump actions/upload-artifact from 7.0.1 to 7.0.2 (#965)
  • change: Bump astral-sh/setup-uv from 10.2.0 to 10.3.2 (#962)
  • change: Bump dependencies
  • change: Bump dependencies
  • change: Bump pypa/gh-action-pypi-publish from 1.14.2 to 1.14.3 (#961)
  • change: Bump version to 2.8.6
  • change: Bump version to 2.8.7
  • change: Bump version to 2.8.8
  • change: Close the shared socket inheritable object on shutdown
  • change: Drop ASGI response stream on mid-stream errors (#949)
  • change: Keep newlines in WSGI input readlines
  • change: Refactor WSGI input readline
  • change: Update project classifiers
  • …and 2 more

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

emmett-framework/granian was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 944eb086fc2020d910336c4f0bdb170012178025 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-e1a3b69fc8ee.