Add TurboAPI framework [Python + Zig]#10902
Add TurboAPI framework [Python + Zig]#10902justrach wants to merge 6 commits intoTechEmpower:masterfrom
Conversation
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
|
Great project! I'm looking forward to the results of the tests! |
| def json_test(): | ||
| return {"message": "Hello, World!"} |
There was a problem hiding this comment.
For each request, an object mapping the key message to Hello, World! must be instantiated.
PD: the bench is about serialize a json object, not to send raw text directly, for that is the plaintext bench.
There was a problem hiding this comment.
Here, it's not a string that's returned from the function, but a dictionary. The framework internally serializes the dictionary (a collection of objects) into a byte array.
Example:
FrameworkBenchmarks/frameworks/Python/emmett/app.py
Lines 41 to 45 in a087d02
There was a problem hiding this comment.
Fixed — added TURBO_DISABLE_CACHE=1 to ensure the dict is created and serialized fresh on every request. No caching.
There was a problem hiding this comment.
Thanks for clarifying — yes, it returns a dict that the framework serializes internally. Also disabled response caching to ensure it's fresh per request.
|
|
||
| # Bust Docker cache for git clone | ||
| ARG CACHEBUST=1 | ||
| RUN git clone --depth 1 --branch main https://github.com/justrach/turboAPI.git . && \ |
There was a problem hiding this comment.
@justrach
For tests to be repeatable, there is no need to specify the repository HEAD!
By the way, the socketify project also abuses this.
There was a problem hiding this comment.
Fixed — both repos now pinned to specific tags (turboAPI v1.0.17, dhi v1.2.1).
| # Bust Docker cache for git clone | ||
| ARG CACHEBUST=1 | ||
| RUN git clone --depth 1 --branch main https://github.com/justrach/turboAPI.git . && \ | ||
| git clone --depth 1 https://github.com/justrach/dhi.git /dhi |
|
Please add yourself to the maintainers in the So with any change or marked as broken, you will be notified. Example: |
| WORKDIR /turboapi | ||
|
|
||
| # Bust Docker cache for git clone | ||
| ARG CACHEBUST=1 |
There was a problem hiding this comment.
This is unnecessary !!
When you add the version in Git clone.
- Add maintainers field to benchmark_config.json - Disable response caching (TURBO_DISABLE_CACHE=1) for TFB compliance - Remove unnecessary ARG CACHEBUST - Pin turboAPI to v1.0.17, dhi to v1.2.1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
@app.get,@app.post, Depends, middleware)Test endpoints
/json{"message":"Hello, World!"}/plaintextHello, World!Local verification
Files
frameworks/Python/turboapi/benchmark_config.jsonframeworks/Python/turboapi/turboapi.dockerfileframeworks/Python/turboapi/app.pyframeworks/Python/turboapi/README.mdDocker
Uses
uvto install Python 3.14t free-threaded + Zig 0.15 for the native HTTP backend. Builds and runs on both x86_64 and aarch64.