Skip to content

Tenchi

Pre-1.0 software

Tenchi is ready for evaluation and real application feedback, but its public API can still change between minor releases. Read stability and releases before adopting it for a long-lived service.

A contract-first, Python-native framework for typed JSON APIs and AI-facing tools that stay coherent as they grow.

Tenchi gives the HTTP boundary, application tools, use cases, a typed Python client, OpenAPI, compatibility checks, and structural tooling one shared model. Contracts describe what crosses the wire. Plain async functions own behavior. Protocols and frozen dataclasses keep dependencies explicit.

Start an application

uvx tenchi new my_app
cd my_app
uv sync
uv run tenchi check
uv run tenchi dev

The generated application includes a working todos feature, SQLite runtime persistence, a memory test adapter, Swagger UI, strict Pyright configuration, OpenAPI and application-tool snapshots, an agent guide, and CI. The quickstart follows its first development loop.

What makes it different

One declaration, several guarantees

from pydantic import BaseModel, Field
from tenchi.contracts import contract


class CreateTodo(BaseModel):
    title: str = Field(min_length=1)


class Todo(BaseModel):
    id: str
    title: str
    completed: bool


create_todo_contract = contract(
    method="POST",
    path="/todos",
    request=CreateTodo,
    response=Todo,
    status=201,
)

That value can be bound to a use case, called through the typed client, served as OpenAPI 3.1, and compared against a previous release.