puff  by hansonkd

Deep stack runtime for Python and Rust, powering AI agents and high-performance applications

Created 3 years ago
326 stars

Top 83.6% on SourcePulse

GitHubView on GitHub
Project Summary

Puff is a "deep stack" Python runtime designed to bridge Python's ease of use with Rust's performance. It targets developers building complex applications like AI agents, GraphQL services, and distributed systems, offering an all-in-one solution that integrates databases, caching, task queues, and LLM orchestration within a single binary, aiming to minimize setup complexity and maximize scalability.

How It Works

Puff leverages a Rust-based Tokio runtime to manage I/O and high-performance components, while Python code executes on a free-threaded pool. This architecture allows Python to leverage Rust's speed for critical paths (like LLM calls, database access) via PyO3 FFI, without blocking the entire application. It enables seamless integration of Rust and Python within the same process, eliminating the need for inter-process communication or serialization for internal calls. The agent runtime specifically uses this to provide a cohesive environment for AI agents, managing state, tools, and orchestration.

Quick Start & Requirements

  • Installation: Requires Rust toolchain (cargo install puff-rs). Python >= 3.10 is necessary. Poetry is optional.
  • Setup: Python projects must be discoverable by Puff (e.g., via PYTHONPATH or virtual environments).
  • Links: No specific quick-start or demo links are provided beyond CLI commands.

Highlighted Details

  • AI Agent Runtime: Integrated runtime for agents with tools, memory, and orchestration.
  • Multi-provider LLM Gateway: Supports Anthropic, OpenAI, Ollama with streaming, retries, and fallbacks.
  • Three-Tier Memory: Utilizes Redis (history), Postgres+pgvector (long-term), and working memory.
  • Multi-agent Orchestration: Supports Router, Supervisor, Chain, and Parallel patterns.
  • Rust/Python Integration: Native execution within the same process, leveraging Rust's Tokio runtime for Python threads.
  • High-Performance HTTP Server: Integrates Axum with Python WSGI apps (Flask, Django).
  • GraphQL: Layer-based engine avoiding N+1 issues, with Rust query execution.
  • Distributed Task Queue: Redis-powered, at-least-once execution with priorities, delays, and retries.

Maintenance & Community

Puff v2 is in active development with an ambitious scope; contributions are welcomed. No specific community channels or detailed contributor information are provided in the README.

Licensing & Compatibility

The README does not specify a software license. This is a critical omission for due diligence, preventing assessment of commercial use or linking compatibility.

Limitations & Caveats

The project is in active development (v2), and users should expect ongoing evolution and potential changes. The ambitious scope means features are still maturing, and stability should be evaluated based on specific use cases. The lack of a stated license is a significant adoption blocker.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.