Skip to content
๐Ÿ‡ฎ๐Ÿ‡ณ Born in India ยท Built for the world

Shakti Python Framework

The AI-first Python web framework, built on async ASGI.
Everything you need to build APIs, web applications, and AI agents โ€” one install, zero config.

pip install "shakti-framework[all]"

Shakti Python Framework is an open-source, AI-first Python web framework for teams who want an async foundation โ€” routing, an async ORM, authentication, and AI integration โ€” without stitching together a dozen separate libraries. If you've used FastAPI, Flask, or Django, Shakti's Quick Start will feel familiar; the full documentation covers everything from your first route to deploying an AI agent in production.


249
Tests Passing
13
Modules
0.2.5
Latest Version
MIT
License

Everything Included

โšก

Async First

Built on ASGI from day one. Handles thousands of concurrent requests with full async/await support.

๐Ÿค–

Built-in AI

Claude and OpenAI support out of the box. Chat, streaming, RAG, and agents โ€” 3 lines of code.

๐Ÿ—„๏ธ

Async ORM

SQLAlchemy async with auto migrations, repository pattern, and one-command CRUD generation.

๐Ÿ”

Auth Built-in

JWT tokens, refresh tokens, RBAC, API keys, and password hashing โ€” all ready to use.

๐Ÿ–ฅ๏ธ

Admin Panel

Auto-generated dark/light mode admin UI for any model. No extra setup needed.

๐Ÿ”Œ

WebSockets

Real-time connections with JSON messaging, path parameters, and AI streaming support.

๐Ÿ“„

Document AI

PDF extraction, image OCR via Claude Vision, document Q&A, and structured data extraction.

โš™๏ธ

Background Jobs

Async job queue with automatic retry, exponential backoff, and interval scheduling.

๐Ÿ“Š

Monitoring

Live dashboard, health checks, request metrics, CPU/memory usage โ€” zero configuration.

๐Ÿ›ก๏ธ

Rate Limiting

Per-IP rate limiting middleware with automatic 429 responses and Retry-After headers.

๐Ÿ“ง

Email

Send emails in 2 lines. SMTP with TLS/SSL, HTML support, CC, BCC โ€” async and non-blocking.

๐Ÿ“–

OpenAPI / Swagger

Auto-generated API documentation at /docs and /redoc โ€” no extra code needed.


60 Seconds to a Full AI App

from shakti import Shakti, Depends
from shakti.config import Config
from shakti.orm import Database
from shakti.auth import Auth
from shakti.auth.models import User
from shakti.ai import AI
from shakti.admin import Admin
from shakti.monitoring import Monitor
from shakti.workflows import WorkflowEngine
from shakti.websocket import WebSocket

config = Config()
app = Shakti(title="My App", config=config)

db = Database(config.require("database.url"))
db.init_app(app)

auth = Auth(db, secret_key=config.require("auth.secret_key"))
auth.init_app(app)

ai = AI(config)
ai.init_app(app)

admin = Admin(db, auth, title="My Admin")
admin.register(User)
admin.init_app(app)

monitor = Monitor()
monitor.init_app(app)

workflows = WorkflowEngine()
workflows.init_app(app)

@app.get("/")
async def index() -> dict:
    return {"framework": "Shakti", "status": "running"}

@app.get("/me")
async def me(user: User = Depends(auth.get_current_user())) -> dict:
    return user.to_dict()

@app.websocket("/ws/chat")
async def chat(ws: WebSocket) -> None:
    await ws.accept()
    async for msg in ws.iter_json():
        reply = await ai.chat(msg["text"])
        await ws.send_json({"reply": reply})

You now have:

  • โœ… REST API with JWT auth
  • โœ… AI chat at POST /ai/chat
  • โœ… WebSocket AI streaming at ws://localhost:8000/ws/chat
  • โœ… Admin panel at /admin/
  • โœ… Monitoring dashboard at /monitor/
  • โœ… Background job queue
  • โœ… OpenAPI docs at /docs

Auto CRUD Generation

Generate a complete API in one command:

# Create model + full CRUD endpoints
shakti generate api Post title:str body:text views:int

# Run migrations
shakti makemigrations "add posts"
shakti migrate

You instantly get:

Method Route Description
GET /posts List all posts
POST /posts Create a post
GET /posts/{id} Get one post
PUT /posts/{id} Update a post
DELETE /posts/{id} Delete a post

Sample Response

Hit any auto-generated endpoint and get clean JSON back, no boilerplate:

curl http://127.0.0.1:8000/posts
[
  {
    "id": 1,
    "title": "Hello, Shakti",
    "body": "My first post using Shakti Framework.",
    "views": 42
  },
  {
    "id": 2,
    "title": "Async ORM in action",
    "body": "Migrations, repositories, and CRUD in one command.",
    "views": 17
  }
]

Install

pip install "shakti-framework[all]"
pip install "shakti-framework[server]"      # + uvicorn
pip install "shakti-framework[orm]"         # + SQLAlchemy
pip install "shakti-framework[auth]"        # + JWT + bcrypt
pip install "shakti-framework[ai]"          # + Claude/OpenAI
pip install "shakti-framework[monitoring]"  # + psutil
pip install shakti-framework

Quick Start

pip install "shakti-framework[all]"
shakti new myapp
cd myapp
shakti run --reload

Open http://127.0.0.1:8000 โ€” your app is running. ๐Ÿš€


MIT License ยท Built by Aditya Bhat ยท Made in India ๐Ÿ‡ฎ๐Ÿ‡ณ