Robyn
llms.txt7.4k starsChanged 17 months agoBSD-2-ClauseView on GitHub
Robyn is a high-performance, community-driven, and innovator-friendly async web framework for Python with a Rust runtime. It combines Python's ease of use with Rust's performance.
- Installs packages
We split this llms.txt into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 40
Middlewares: Before/after request middlewares
≈ “Common” is an estimate: at least 1 in 5 of the 3,225 llms.txt files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
# Robyn
> Robyn is a high-performance, community-driven, and innovator-friendly async web framework for Python with a Rust runtime. It combines Python's ease of use with Rust's performance.
## Quick Facts
- Version: 0.79.0
- Python: >= 3.10
- License: BSD 2.0
- Repository: https://github.com/sparckles/robyn
- Documentation: https://robyn.tech/documentation
- Discord: https://discord.gg/rkERZ5eNU8
## Installation
```bash
pip install robyn
```
## Basic Usage
```python
from robyn import Robyn
app = Robyn(__file__)
@app.get("/")
async def index(request):
return "Hello, World!"
app.start(port=8080)
```
## Key Features
- **Rust Runtime**: Core server written in Rust using actix-web for high performance
- **Async/Sync Support**: Both async and sync route handlers supported
- **Multi-Process Scaling**: Built-in multiprocess execution via `--processes` and `--workers`
- **WebSockets**: Native WebSocket support
- **Middlewares**: Before/after request middlewares
- **Dependency Injection**: Built-in DI system
- **OpenAPI/Swagger**: Automatic OpenAPI documentation generation
- **Hot Reloading**: Development mode with `--dev` flag
- **AI Agents**: Built-in AI agent routing via `robyn.ai`
- **MCP Support**: Model Context Protocol server capabilities via `app.mcp`
- **Templating**: Jinja2 templating support (optional)
- **CORS**: Built-in CORS helper via `ALLOW_CORS()`
- **Authentication**: AuthenticationHandler base class for custom auth
- **Static Files**: Directory serving via `app.serve_directory()`
- **SSE**: Server-Sent Events support via `SSEResponse`
- **Easy Access Parameters**: Typed path/query params with automatic coercion in handler signatures
- **Direct Rust Integration**: Embed Rust code directly in routes
## Project Structure
```
robyn/
├── src/ # Rust source code
│ ├── lib.rs # PyO3 module entry point
│ ├── server.rs # Main HTTP server implementation
│ ├── types/ # Request, Response, Headers, Cookie types
│ ├── routers/ # HTTP, WebSocket, middleware routers
│ ├── executors/ # Route execution handlers
│ └── websockets/ # WebSocket implementation
├── robyn/ # Python package
│ ├── __init__.py # Main Robyn and SubRouter classes
│ ├── router.py # Python router implementation
│ ├── authentication.py # AuthenticationHandler
│ ├── dependency_injection.py
│ ├── openapi.py # OpenAPI generation
│ ├── mcp.py # MCP protocol support
│ ├── ai.py # AI agent support
│ ├── responses.py # Response helpers (serve_file, html, SSE)
│ ├── ws.py # WebSocket class
│ └── robyn.pyi # Type stubs
├── integration_tests/ # Integration test suite
├── unit_tests/ # Unit test suite
├── docs_src/ # Documentation (Next.js)
├── granian/ # Bundled Granian server (fork)
└── examples/ # Example applications
```
## Core Classes
### Robyn / SubRouter
Main application class and sub-router for modular routes.
```python
from robyn import Robyn, SubRouter
app = Robyn(__file__)
api = SubRouter(__file__, prefix="/api")
@api.get("/users")
def get_users(request):
return {"users": []}
app.include_router(api)
```
### Request Object
```python
request.method # HTTP method
request.url # Url object (scheme, host, path)
request.headers # Headers dict-like
request.query_params # QueryParams
request.path_params # Dict of URL params
request.body # Raw bytes
request.json() # Parse JSON body
request.form_data # Multipart form data
request.ip_addr # Client IP
request.identity # Identity (if authenticated)
```
### Response Object
```python
from robyn import Response
Response(
status_code=200,
headers={"Content-Type": "application/json"},
description="body content" # or body bytes
)
```
### Decorators
```python
@app.get("/path")
@app.post("/path")
@app.put("/path")
@app.delete("/path")
@app.patch("/path")
@app.head("/path")
@app.options("/path")
@app.before_request("/path") # Middleware before
@app.after_request("/path") # Middleware after
@app.startup_handler # Server startup
@app.shutdown_handler # Server shutdown
```
### WebSockets
```python
from robyn import WebSocketDisconnect
@app.websocket("/ws")
async def handler(websocket):
try:
while True:
msg = await websocket.receive_text()
await websocket.send_text(f"Echo: {msg}")
except WebSocketDisconnect:
pass
@handler.on_connect
def on_connect(websocket):
return "Connected"
@handler.on_close
def on_close(websocket):
return "Closed"
```
### Easy Access Parameters
Declare typed path and query parameters directly in handler signatures. Works for both HTTP and WebSocket handlers.
```python
from typing import List, Optional
# HTTP: path params + query params with type coercion
@app.get("/items/:id")
async def get_item(id: int, q: str, page: int = 1):
return {"id": id, "q": q, "page": page}
# Optional, List, and bool params
@app.get("/search")
def search(name: str, tags: List[str], active: bool = False, age: Optional[int] = None):
return {"name": name, "tags": tags, "active": active, "age": age}
# WebSocket: typed query params on handler and callbacks
@app.websocket("/ws")
async def handler(websocket, room: str = "default", page: int = 1):
while True:
msg = await websocket.receive_text()
await websocket.send_text(f"room={room} page={page} msg={msg}")
@handler.on_connect
def on_connect(websocket, room: str = "default"):
return f"connected to {room}"
```
### MCP (Model Context Protocol)
```python
@app.mcp.resource("time://current")
def get_time():
return datetime.now().isoformat()
@app.mcp.tool(name="calc", description="Calculate", input_schema={...})
def calculate(args):
return eval(args["expression"])
@app.mcp.prompt(name="explain", description="Explain code", arguments=[...])
def explain_prompt(args):
return f"Please explain: {args['code']}"
```
## CLI Commands
```bash
python app.py # Start server
python app.py --dev # Development mode (hot reload)
python app.py --processes 4 # Multi-process
python app.py --workers 2 # Workers per process
python app.py --log-level DEBUG # Log level
python app.py --open-browser # Open browser on start
python app.py --create # Create new project scaffold
python app.py --docs # Open documentation
```
## Development Setup
```bash
# Clone
git clone https://github.com/sparckles/robyn.git
cd robyn
# Virtual environment
python3 -m venv .venv && source .venv/bin/activate
# Install tools
pip install pre-commit poetry maturin
# Install dependencies
poetry install --with dev --with test
# Build Rust extension
maturin develop
# Run tests
pytest
```
## Key Dependencies
- **PyO3**: Rust-Python bindings
- **actix-web**: Rust HTTP server (via cookie crate)
- **orjson**: Fast JSON serialization
- **multiprocess**: Multi-process support
- **uvloop**: Fast event loop (non-Windows)
- **watchdog**: File watching for hot reload
## Configuration
Environment variables:
- `ROBYN_HOST`: Server host (default: 127.0.0.1)
- `ROBYN_PORT`: Server port (default: 8080)
- `ROBYN_DEV_MODE`: Enable dev mode
- `ROBYN_BROWSER_OPEN`: Open browser on start
- `ROBYN_CLIENT_TIMEOUT`: Client timeout seconds
- `ROBYN_KEEP_ALIVE_TIMEOUT`: Keep-alive timeout
## Documentation Structure
Main docs at `docs_src/src/pages/documentation/`:
- `api_reference/getting_started.mdx` - Quick start guide
- `api_reference/request_object.mdx` - Request handling
- `api_reference/middlewares.mdx` - Middleware usage
- `api_reference/websockets.mdx` - WebSocket guide
- `api_reference/authentication.mdx` - Auth patterns
- `api_reference/openapi.mdx` - OpenAPI docs
- `api_reference/agents.mdx` - AI agent integration
- `api_reference/mcps.mdx` - MCP server guide
- `example_app/` - Full example application tutorial
Trending
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about sparckles/Robyn
- @matsuu.bsky.social“Python向けのWebフレームワーク。Rust実装。このあたりもRustで実装され始めるのか。”Bluesky · Mar 9, 2025 · 6 likes
- A Hacker News story“Robyn: A curiously fast Python/Rust web framework”Hacker News · Nov 24, 2025 · 2 points
- A Hacker News story“Robyn – A super fast Python web framework written in Rust”Hacker News · Aug 28, 2024 · 2 points
- NixOS/nixpkgs“Package request: Robyn Web Framework”GitHub · Jul 17, 2024 · 2 reactions
- A Hacker News story“Robyn – Python Web Framework in Rust”Hacker News · Nov 27, 2023 · 2 points
The biggest 5 of 55 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 55
Talked about on GitHub, Hacker News and Bluesky (55 times).
On GitHub · 50
- Jul 17, 2024Package request: Robyn Web Framework — NixOS/nixpkgs2 reactions · 1 comment
- Oct 24, 2026deps(backend): bump the production-deps group across 1 directory with 10 updates — lasertsole/sherry_agent0 reactions · 1 comment
- Oct 24, 2026deps(backend): bump the production-deps group across 1 directory with 10 updates — lasertsole/sherry_agent0 reactions · 1 comment
- Oct 19, 2026deps(backend): bump the production-deps group across 1 directory with 11 updates — lasertsole/sherry_agent0 reactions · 2 comments
- Oct 19, 2026deps(backend): bump the production-deps group across 1 directory with 11 updates — lasertsole/sherry_agent0 reactions · 2 comments
45 more on GitHub
- Oct 18, 2026deps(backend): bump the production-deps group across 1 directory with 10 updates — lasertsole/sherry_agent0 reactions · 2 comments
- Oct 14, 2026deps(backend): bump the production-deps group with 9 updates — lasertsole/sherry_agent0 reactions · 2 comments
- Oct 14, 2026deps(backend): bump the production-deps group with 9 updates — lasertsole/sherry_agent0 reactions · 2 comments
- Oct 5, 2026deps(backend): bump the production-deps group across 1 directory with 8 updates — lasertsole/sherry_agent0 reactions · 2 comments
- Sep 28, 2026deps(backend): bump the production-deps group across 1 directory with 8 updates — lasertsole/sherry_agent0 reactions · 2 comments
- Sep 14, 2026deps(backend): bump the production-deps group across 1 directory with 8 updates — lasertsole/sherry_agent0 reactions · 2 comments
- Sep 9, 2026deps(backend): bump the production-deps group with 9 updates — lasertsole/sherry_agent0 reactions · 2 comments
- Aug 25, 2026feat: opt-in Rust extension module (include_rust) — PyO3 + maturin accelerator with cross-platform wheels — hasansezertasan/copier-pyproject0 reactions
- Jun 25, 2026Update dependency robyn to >=0.88,<0.89 — the-benchmarker/web-frameworks0 reactions
- Jun 21, 2026Update dependency robyn to >=0.87,<0.88 — the-benchmarker/web-frameworks0 reactions
- Jun 16, 2026Update dependency robyn to >=0.86,<0.87 — the-benchmarker/web-frameworks0 reactions
- May 22, 2026Feature Request: Rust-native event loop for Python coroutines — jagadeesh32/cello0 reactions · 2 comments
- May 20, 2026Add Python Robyn analyzer — owasp-noir/noir0 reactions
- May 1, 2026Bump robyn from 0.82.1 to 0.84.0 in /backend — ben-burwood/punchcard0 reactions · 1 comment
- May 1, 2026Bump robyn from 0.82.1 to 0.84.0 in /backend — ben-burwood/sqwark0 reactions · 1 comment
- Mar 29, 2026Update Robyn to 0.82.1, Python to 3.14 — the-benchmarker/web-frameworks0 reactions
- Mar 21, 2026fix(deps): update dependency robyn to >=0.82,<0.83 — the-benchmarker/web-frameworks0 reactions · 1 comment
- Mar 13, 2026fix(deps): update dependency robyn to >=0.81,<0.82 — the-benchmarker/web-frameworks0 reactions
- Mar 6, 2026fix(deps): update dependency robyn to >=0.80,<0.81 — the-benchmarker/web-frameworks0 reactions
- Mar 1, 2026fix(deps): update dependency robyn to >=0.79,<0.80 — the-benchmarker/web-frameworks0 reactions · 1 comment
- Feb 16, 2026build(deps): bump robyn from 0.72.2 to 0.88.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Feb 9, 2026build(deps): bump robyn from 0.72.2 to 0.77.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jan 26, 2026build(deps): bump robyn from 0.72.2 to 0.76.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jan 20, 2026build(deps): bump robyn from 0.72.2 to 0.75.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jan 19, 2026chore(deps): bump robyn from 0.72.2 to 0.74.0 — 5herlocked/stock-agent0 reactions
- Jan 14, 2026build(deps): bump robyn from 0.72.2 to 0.74.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Sep 29, 2025chore(deps): bump robyn from 0.72.0 to 0.72.2 — 5herlocked/stock-agent0 reactions
- Sep 8, 2025build(deps): bump robyn from 0.72.0 to 0.72.2 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Sep 4, 2025build(deps): bump robyn from 0.72.0 to 0.72.1 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jul 24, 2025fix(deps): update dependency robyn to >=0.72,<0.73 — the-benchmarker/web-frameworks0 reactions
- Jul 13, 2025fix(deps): update dependency robyn to >=0.71,<0.72 — the-benchmarker/web-frameworks0 reactions
- Jul 8, 2025build(deps): bump robyn from 0.69.0 to 0.71.1 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jul 7, 2025build(deps): bump robyn from 0.69.0 to 0.71.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jun 19, 2025build(deps): bump robyn from 0.66.2 to 0.69.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jun 9, 2025build(deps): bump robyn from 0.66.2 to 0.68.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jun 5, 2025build(deps): bump robyn from 0.66.2 to 0.67.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- May 18, 2025move to robyn — nozomio-labs/nia-docs0 reactions
- Apr 28, 2025build(deps): bump robyn from 0.65.0 to 0.66.2 — neonlabsorg/neon-proxy.py0 reactions
- Jan 13, 2025build(deps): bump robyn from 0.64.2 to 0.65.0 — neonlabsorg/neon-proxy.py0 reactions · 1 comment
- Jan 7, 2025fix(deps): update dependency robyn to >=0.65,<0.66 — the-benchmarker/web-frameworks0 reactions
- Jan 7, 2025build(deps): bump robyn from 0.64.2 to 0.65.0 — neonlabsorg/neon-proxy.py0 reactions
- Dec 13, 2024Add python3-robyn-pip — ros/rosdistro0 reactions · 2 comments
- Nov 27, 2024build(deps): bump robyn from 0.64.1 to 0.64.2 — neonlabsorg/neon-proxy.py0 reactions
- Nov 18, 2024build(deps): bump robyn from 0.64.0 to 0.64.1 — neonlabsorg/neon-proxy.py0 reactions
- Nov 12, 2024build(deps): bump robyn from 0.63.0 to 0.64.0 — neonlabsorg/neon-proxy.py0 reactions
On Hacker News · 4
- Nov 24, 2025Robyn: A curiously fast Python/Rust web framework2 points · 1 comment
- Aug 28, 2024Robyn – A super fast Python web framework written in Rust2 points
- Nov 27, 2023Robyn – Python Web Framework in Rust2 points · 2 comments
- Nov 7, 2023Robyn: High-Performance and Community-Driven Python Web Framework1 point
On Bluesky · 1
- Mar 9, 2025Python向けのWebフレームワーク。Rust実装。このあたりもRustで実装され始めるのか。 — @matsuu.bsky.social6 likes and reposts
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

