Skip to main content

Pyvello

A Python-First Reactive AI UI Framework with React 18, shadcn/ui, LiteLLM Agent Swarms, and Automatic Graph Visualization

Write pure Python. Get an enterprise-grade React 18 UI with Tailwind CSS and Radix UI primitives. Build autonomous multi-agent swarms with LiteLLM, attach tools (RAG, SQL, Sheets, Gmail), connect self-hosted inference clusters (vLLM, Ollama), and observe execution in real-time over persistent WebSockets.


Features

  • Python-First Simplicity: Build full web applications without writing React, JSX, or CSS.
  • shadcn/ui & 18 Calibrated Palettes: Coherent design tokens, dark and light modes, accessible Radix UI primitives, clean typography.
  • LiteLLM Multi-Agent Swarms: Implement all 6 Anthropic patterns (Prompt Chaining, Routing, Parallelization, Orchestrator-Workers, Evaluator-Optimizer, and Autonomous Multi-Tool) across 100+ models.
  • Custom Inference Base URLs: Route requests to self-hosted vLLM clusters (http://localhost:8000/v1), local Ollama (http://localhost:11434/v1), LM Studio, or OpenRouter via api_base.
  • Builtin Enterprise Tools: Out-of-the-box, fully runnable tools for RAG vector search, relational SQL databases, Google Sheets sync, and Gmail dispatch.
  • Universal API Client (pyvello.api): Axios-style REST client, SSE streaming, and WebSockets with automatic component loading state orchestration (with api.loading(btn, card): ...).
  • Real-Time Agent Graph Visualization: Live interactive canvas powered by @xyflow/react and Dagre auto-layout. Watch nodes execute with live duration tracking, token telemetry, and slide-over inspectors.
  • Production DataTable: Sorting, global search, pagination, and 3-dots action menus with conditional visibility rules.
  • Interactive SVG Charts: Area charts, bar charts, line charts, and donut charts with responsive tooltips.
  • Zero-Node Runtime with Instant Hot Reloading: Production React bundle is packaged directly inside the Python wheel. Hot reload is enabled by default for rapid local development.
  • Jupyter Notebook & Google Colab Support: Embed responsive full-stack apps inline inside .ipynb cells via non-blocking background threads.
  • LangGraph-Style Conditional Tool Nodes: Dedicated tool nodes connected with conditional call and result return edges, rendered on a full-screen canvas.

Quickstart

1. Installation

pip install pyvello

All dependencies (FastAPI, Uvicorn, LiteLLM, HTTPX, WebSockets, Pydantic, Watchfiles) install automatically.


2. Autonomous Multi-Tool Agent (RAG, SQL, Sheets, Gmail)

import pyvello as ui
from pyvello.tools import (
    query_knowledge_base,
    query_database,
    read_google_sheet,
    send_gmail_message,
)

# Initialize Agent with Tools, Model Switching, and Custom Base URL
agent = ui.agent(
    name="EnterpriseOpsAgent",
    model="gpt-4o",
    models=[
        {"id": "gpt-4o", "name": "GPT-4o (OpenAI)", "badge": "Cloud"},
        {"id": "claude-3-5-sonnet", "name": "Claude 3.5 Sonnet", "badge": "Coding"},
        {"id": "meta-llama/Llama-3.3-70B-Instruct", "name": "Llama 3.3 (Local vLLM)", "badge": "Local GPU"},
    ],
    system_prompt="You are an enterprise operations assistant. Use RAG for policies, SQL for DB queries, Sheets for CRM deals, and Gmail to dispatch summaries.",
    tools=[query_knowledge_base, query_database, read_google_sheet, send_gmail_message],
    temperature=0.2,
    api_base="http://localhost:8000/v1",  # Self-hosted vLLM / Ollama endpoint
)

# Launch interactive UI with one call
agent.to_app().launch()

3. Multi-Agent Swarm Orchestrator

import pyvello as ui

# 1. Specialized Worker Subagents
market_worker = ui.agent(name="MarketResearcher", system_prompt="Analyze target addressable market and unit economics.")
infra_worker = ui.agent(name="InfraArchitect", system_prompt="Specify cloud infrastructure and multi-region Kubernetes nodes.")
risk_worker = ui.agent(name="RiskAssessor", system_prompt="Evaluate compliance, HIPAA guidelines, and operational risk.")

# 2. Dynamic Swarm Orchestrator with Supervisor System Prompt & Model Selection
orchestrator = ui.orchestrator(
    agents=[market_worker, infra_worker, risk_worker],
    supervisor_system_prompt="You are an enterprise software architect supervising junior engineers. Decompose goals and synthesize verified deliverables.",
    supervisor_model="gpt-4o",
    models=[
        {"id": "gpt-4o", "name": "GPT-4o (Supervisor)", "badge": "Cloud"},
        {"id": "claude-3-5-sonnet", "name": "Claude 3.5 Sonnet", "badge": "Coding"},
        {"id": "meta-llama/Llama-3.3-70B-Instruct", "name": "Llama 3.3 (vLLM :8000)", "badge": "Local GPU"},
    ],
    temperature=0.2,
    stream=True,
    structured_output={"type": "json_object"},
    api_base="http://localhost:8000/v1",  # Cascades to workers automatically!
)

# 3. Mount in Reactive Chat UI
orchestrator.to_app().launch()

4. Universal API Client & Automatic Loading States

from pyvello import api, ui

client = api.ApiClient(base_url="https://api.mycompany.org/v1")

with ui.App("Telemetry Dashboard"):
    m1 = ui.metric("Active Sessions", "14,280")
    btn = ui.button("Sync Telemetry", icon="RefreshCw", loader_style="spinner")

    # Automatically sets button loading=True, renders spinner, and restores on complete
    @btn.on("click")
    def on_sync():
        with api.loading(btn, m1):
            res = client.get("/telemetry/metrics")
            ui.update(m1, value=res.json()["active_sessions"])
            ui.toast("Metrics synchronized!", "success")

5. Custom Tools with Automatic JSON Schema Extraction

import pyvello as ui

@ui.tool(description="Calculate portfolio Sharpe ratio given returns and risk-free rate")
def calculate_sharpe(returns: list[float], risk_free_rate: float = 0.04) -> float:
    mean_ret = sum(returns) / len(returns)
    variance = sum((r - mean_ret) ** 2 for r in returns) / len(returns)
    std_dev = variance ** 0.5
    return (mean_ret - risk_free_rate) / std_dev if std_dev > 0 else 0.0

agent = ui.agent(
    name="PortfolioAnalyst",
    tools=[calculate_sharpe],
    model="gpt-4o"
)

All 6 Agent Architecture Patterns Supported

Pattern Class / Function Description
1. Autonomous Multi-Tool ui.agent(tools=[...]) Dynamic tool calling loop with automatic progress & result cards.
2. Prompt Chaining ui.chain(steps=[...]) Sequential LLM pipeline with programmatic validation gates.
3. Routing / Intent Agent ui.router(routes={...}) Semantic intent classification and specialist handoff.
4. Parallelization ui.parallel(mode="sectioning" | "voting") Concurrent subtask sectioning or majority voting consensus.
5. Orchestrator-Workers ui.orchestrator(agents=[...]) Dynamic task decomposition with configurable supervisor prompt.
6. Evaluator-Optimizer ui.judge(rubric=..., threshold=4.0) LLM-as-Judge scorecard evaluation with automated self-correction.

18 Calibrated Theme Palettes

Red (palette="red") is configured as the framework default theme palette. You can pass any of the 18 calibrated theme palettes to ui.App, ui.ChatInterface, or agent.to_app():

red (default), rose, violet, indigo, blue, sky, cyan, teal, emerald, green, yellow, amber, orange, zinc, slate, stone, gray, neutral.

Toggle dark and light modes with persistent client preference syncing.


CLI & Notebook Reference

# Start local dev server (Hot reload enabled by default)
pyvello run app.py

# Specify port or disable reload if needed
pyvello run app.py --port 8000 --no-reload

# Export application to a standalone React 18 + Vite 5 project
pyvello export app.py --output dist/

Jupyter Notebook (.ipynb) Inline Embedding

import pyvello as ui

agent = ui.agent(name="Analyst", system_prompt="You are a data analyst.")

# Embeds directly into the notebook output cell without blocking kernel:
agent.to_app().launch(inline=True, height=750)

License

MIT License.

Metadata

Release files for pyvello 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvello 0.1.2
File Size Uploaded Provenance Actions
pyvello-0.1.2.tar.gz 1.9 MB Without provenance Details for pyvello-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyvello 0.1.2
File Interpreter ABI Platform Actions
pyvello-0.1.2-py3-none-any.whl Python 3 none any Details for pyvello-0.1.2-py3-none-any.whl

Total release size: 3.8 MB

Release files / pyvello-0.1.2.tar.gz

Download URL pyvello-0.1.2.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
0410991a1d433697b1b2eadd74dc9817377c255e4ced3a9e11e1f15f469f865d
BLAKE2b-256 checksum
How to use checksums
1427d0b6161ef1163fdb96edab0265b2421f7b9ebeb1a3a4554aa10b4d4f7ace
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / pyvello-0.1.2-py3-none-any.whl

Download URL pyvello-0.1.2-py3-none-any.whl
Size 1.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ed2a19bc716084cb39c0febc35571de637aa73f43e5d8c1aa44a0546b3b35e7b
BLAKE2b-256 checksum
How to use checksums
afa7a9b3adf4488e9e133d08b43d4c420deb82eaebc2cc6d65021c1245bcb0d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Security for pyvello 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page