Skip to content

Add TurboAPI framework [Python + Zig]#10902

Open
justrach wants to merge 5 commits intoTechEmpower:masterfrom
justrach:master
Open

Add TurboAPI framework [Python + Zig]#10902
justrach wants to merge 5 commits intoTechEmpower:masterfrom
justrach:master

Conversation

@justrach
Copy link

New Framework: TurboAPI

Language: Python 3.14t (free-threaded, no GIL)
HTTP Core: Zig 0.15 native server (24-thread pool)
Tests: json, plaintext

What is TurboAPI?

TurboAPI is a drop-in FastAPI replacement that moves the entire HTTP layer (TCP, parsing, routing, JSON serialization, CORS) into Zig. Python only runs your business logic.

  • FastAPI-compatible API (@app.get, @app.post, Depends, middleware)
  • 287 tests passing
  • Zero-alloc response pipeline (stack buffers, single write syscall)
  • Response caching (body cached after first Python call, subsequent requests skip Python)
  • Zig-native CORS (pre-rendered headers, 0% overhead)

Test endpoints

Test URL Response
JSON /json {"message":"Hello, World!"}
Plaintext /plaintext Hello, World!

Local verification

================================================================================
Verification Summary
--------------------------------------------------------------------------------
| turboapi
|       json          : PASS
|       plaintext     : PASS
================================================================================

Files

  • frameworks/Python/turboapi/benchmark_config.json
  • frameworks/Python/turboapi/turboapi.dockerfile
  • frameworks/Python/turboapi/app.py
  • frameworks/Python/turboapi/README.md

Docker

Uses uv to install Python 3.14t free-threaded + Zig 0.15 for the native HTTP backend. Builds and runs on both x86_64 and aarch64.

justrach and others added 5 commits March 19, 2026 19:14
Docker builds with Python 3.14t free-threaded (via uv) + Zig 0.15.
Both /json and /plaintext endpoints respond correctly.

Known issue: container exits after ~5s due to Linux Zig thread cleanup
segfault (tracked in justrach/turboAPI CI). Server responds to requests
while alive. Needs investigation before official TFB submission.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New framework: TurboAPI
- Language: Python 3.14t (free-threaded)
- HTTP core: Zig 0.15 native server
- Tests: json, plaintext
- Verified locally: both PASS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant