RADUI: Reactive Application Development User Interface framework for Python.
The Python-First Reactive Engine for Enterprise Dashboards, Autonomous AI Agents & Real-Time Web Apps
Live Documentation • 60-Second Quickstart • Interactive Showcase • Benchmarks • Component Reference (68) • CLI Reference (45) • Architecture & ADRs • Developer FAQ
[1;34m[radui] [0m [1;32mStarting RADUI v1.0.0 Server [0m [1;34m[radui] [0m Environment: Production | ASGI 3.0 Engine | Python 3.12.10 [1;34m[radui] [0m Registered 68 AST Components | 12 Route Handlers | 45 CLI Commands [1;34m[radui] [0m In-Memory AST Compilation: [1;32m0.039 ms [0m (Median) [1;34m[radui] [0m HTML Stream Serialization: [1;32m0.038 ms [0m (Median) [1;34m[radui] [0m Sub-DOM Reconciliation Diff: [1;32m0.168 ms [0m (Median) [1;34m[radui] [0m SSE Wire Patch Delivery: [1;32m0.007 ms [0m (Median) [1;34m[radui] [0m Zero JavaScript Build Step | Zero npm dependencies | 9.6 KB Gzip Runtime [1;34m[radui] [0m Serving live dashboard at: [1;36mhttp://localhost:3000 [0m [1;34m[radui] [0m Inspector Control Plane: [1;35mhttp://localhost:3000/_gx/inspect [0m (Ctrl+Shift+I) Why RADUI? RADUI (Reactive Application Development User Interface) unites the unmatched developer velocity of classic Rapid Application Development (RAD) with a hyper-optimized Server-Driven Reactive Engine.
flowchart LR A["Pure Python AST
(Type-Safe Declarative)"] --> B["High-Speed SSR Engine
( C["Interactive Browser DOM
(Zero npm / 9.6KB Runtime)"] C -- "User Action / Form / Event" --> D["Command Dispatch & Idempotency
(Fencing Tokens & Deduplication)"] D --> E["Reactive DAG Runtime
(5-Tier Scoped State & SWR)"] E -- "Surgical SSE Sub-DOM Patch" --> C Click to View Key Differentiators 100% Pure Python: Author layouts, reactivity graphs, async jobs, and tool calls in clean, type-safe Python. No JSX, no TypeScript, no context switching. Zero JavaScript Build Pipeline: Eliminate Node.js, npm, Webpack, Vite, and hydration mismatches. The Python server renders and mutates views directly. Surgical SSE Sub-DOM Morphing: Initial requests receive server-side rendered HTML in under 3.1ms; user interactions stream targeted Server-Sent Event (SSE) patches that morph only mutated DOM elements. Deterministic 5-Tier State Isolation: Clear separation between ephemeral, view, session, user, and app state with fail-closed tenant fencing. Native Streaming AI & MCP Protocol: Out-of-the-box streaming generative UI, Model Context Protocol (MCP) tool integration, and human-in-the-loop approval cards. Distributed Enterprise Hardening: Monotonic fencing tokens, transactional outbox pattern, ACID WAL SQLite & Redis clustering, and OpenTelemetry OTLP tracing. Quickstart in 60 Seconds Create an interactive reactive web app in a single file:
# app.py import radui as ui app = ui.App(title="RADUI 60-Second Reactive Counter") # 1. Declare session-scoped reactive state s_counter = ui.state("counter", default=0, scope="session") # 2. Build declarative AST view @app.page("/") def counter_view(): return ui.container( ui.card( ui.heading("Reactive State Counter", level=2), ui.text("Click the buttons below to trigger surgical SSE sub-DOM updates with zero page reloads:"), ui.metric_card(title="Current Counter Value", value=s_counter, delta="+1 on click"), ui.row( ui.button("Increment", command="counter.inc", variant="primary"), ui.button("Decrement", command="counter.dec", variant="secondary"), ui.button("Reset", command="counter.reset", variant="danger"), gap=12, ), footer=ui.text("Rendered with RADUI v1.0.0 — Pure Python Reactive Runtime", variant="muted"), ) ) # 3. Handle commands with isolated state mutations @app.command("counter.inc") def increment(ctx: ui.CommandContext): ctx.write(s_counter, ctx.read(s_counter) + 1) ui.notify(f"Counter incremented to {ctx.read(s_counter)}", variant="success") @app.command("counter.dec") def decrement(ctx: ui.CommandContext): ctx.write(s_counter, ctx.read(s_counter) - 1) @app.command("counter.reset") def reset(ctx: ui.CommandContext): ctx.write(s_counter, 0) ui.notify("Counter reset to 0", variant="info") if __name__ == "__main__": app.run(port=3000) Run with the developer CLI:
radui dev app.py --port 3000 --open Installation & Packaging Extras Immediate Installation (Direct from GitHub) You can install and use radui directly from GitHub today:
# Core framework runtime pip install "git+https://github.com/flux-py/radui.git" # Full enterprise production bundle (ASGI, PostgreSQL psycopg 3, Redis, OpenTelemetry): pip install "radui[all] @ git+https://github.com/flux-py/radui.git" Standard PyPI Installation # Core framework runtime (when published on PyPI) pip install radui # Full enterprise production bundle: pip install "radui[all]" View Modular Installation Extras Extra Package Command Included Capabilities All Modules pip install "radui[all]" Full production suite (Postgres, Redis, Server, Telemetry) PostgreSQL pip install "radui[postgres]" Native async psycopg 3 and psycopg_pool connection pool Redis pip install "radui[redis]" redis-py for cluster state sharing, SSE replay & job fencing Server pip install "radui[server]" High-throughput uvicorn ASGI production server Telemetry pip install "radui[telemetry]" OpenTelemetry OTLP tracing SDK & span exporters Backward Compatibility & Standard Imports # Modern Standard Idiom (Recommended) import radui as ui # Backward-Compatibility Facade (Guaranteed support through v2.0) import genesis as gx Verified Performance Latency (6-Tier Benchmark Suite) Every release of RADUI is validated against a rigorous 6-tier latency harness (python benchmarks/run.py):
Explore RADUI's core subsystem architecture through expandable interactive guides:
RADUI eliminates global state bugs by enforcing a deterministic 5-tier scoping hierarchy:
graph TD S1["1. Ephemeral Scope
(In-memory request lifecycle)"] --> S2["2. View Scope
(DOM tab & browser tab lifetime)"] S2 --> S3["3. Session Scope
(Signed cookie _gx_sid across reloads)"] S3 --> S4["4. User Scope
(Cross-device authenticated account state)"] S4 --> S5["5. App Scope
(Cluster-wide singleton Redis / Postgres)"] import radui as ui # Define reactive state references across scopes s_query = ui.state("search", default="", scope="view") s_theme = ui.state("theme", default="dark", scope="session") s_profile = ui.state("user_prefs", default={}, scope="user") # Lazy, memoized computed state with DAG cycle detection @ui.computed def s_filtered_results(): return [item for item in all_items if s_query.value.lower() in item["name"].lower()] # Atomic transactional batch mutations @app.command("cart.checkout") def checkout(ctx: ui.CommandContext): with ctx.transaction(): # Auto-rollback on exception ctx.write(s_stock, ctx.read(s_stock) - 1) ctx.write(s_status, "RESERVED") 2. Streaming AI Agent Integration & MCP Protocols (Click to Expand) Integrate autonomous LLM agents, Model Context Protocol (MCP) tools, and streaming generative UI:
import radui as ui @app.page("/assistant") def assistant_page(): return ui.container( ui.chat_view( ui.chat_message("Hello! I am your AI assistant powered by RADUI. How can I help you?", sender="assistant"), height="550px", ), ui.chat_input(command="agent.chat", placeholder="Ask a question or request an action..."), # Human-in-the-loop tool execution approval card ui.action_card( title="Execute Database Query?", description="Agent requests read permission on 'analytics_daily_orders'.", confirm_command="agent.approve_tool", cancel_command="agent.reject_tool", ) ) # Connect functions directly to Model Context Protocol (MCP) @ui.mcp_tool(name="fetch_financials", description="Retrieve quarterly financial KPI records") def fetch_financials(quarter: str) -> dict: return {"quarter": quarter, "revenue": 1420000, "growth": "+18.4%"} 3. Distributed Background Jobs & Lease Fencing (Click to Expand) Execute heavy computational tasks with monotonic fencing tokens and live browser progress updates:
import time import radui as ui def heavy_export_worker(context: ui.JobContext): for step in range(100): if context.is_cancelled(): return time.sleep(0.05) # Transmit real-time progress over SSE context.update_progress((step + 1) / 100.0, f"Exporting records... {step + 1}%") app.register_job("analytics.export", heavy_export_worker) @app.command("analytics.start_export") def start_export(ctx: ui.CommandContext): job_id = ctx.submit_job("analytics.export", {"format": "parquet"}) ui.notify(f"Export job #{job_id} scheduled!", variant="info") 4. SWR Data Engine & Singleflight Deduplication (Click to Expand) Stale-While-Revalidate query caching eliminates redundant database queries:
import radui as ui # Automatic in-flight request deduplication + background revalidation def get_daily_metrics(): return ui.query( "daily_kpis", fetch_kpis_from_database, stale_time=60.0, # Serve cached data for 60s retry=3, # Exponential backoff on failure tenant_id="org_42", # Cryptographic tenant isolation ) # Syntactic decorator for expensive functions @ui.cached(ttl=120.0) def generate_quarterly_report(year: int): return run_heavy_aggregation(year) # Programmatic hierarchical cache invalidation @app.command("metrics.refresh") def refresh(ctx): ui.invalidate_query("daily_kpis*") # Purges all matching prefix keys 5. Transactional Outbox Pattern & Failure Recovery (Click to Expand) Prevent distributed state corruption between local database transactions and external APIs (Stripe, Twilio, LLMs):
sequenceDiagram participant User as Browser participant Server as RADUI Server participant DB as Local Database (ACID) participant Outbox as Outbox Queue participant Ext as External Payment API User->>Server: Click "Purchase" activate Server Server->>DB: BEGIN Transaction Server->>DB: INSERT into orders Server->>Outbox: INSERT into outbox (idempotency_key="pay_101") Server->>DB: COMMIT Transaction Server-->>User: 200 OK (Order Confirmed) deactivate Server Note over Outbox,Ext: Background Worker (Async Fenced Dispatch) Outbox->>Ext: POST /charges (Idempotency-Key: pay_101) Ext-->>Outbox: Charge Succeeded Outbox->>DB: Mark Outbox Task COMPLETED Interactive Component Explorer (68 Built-in Primitives) ComponentRegistry.builtins() provides exactly 68 declarative AST primitives. Every component inherits from Component and supports id, class_name, and inline style.
RADUI provides 45 built-in CLI commands for complete development, testing, auditing, and cloud deployment:
# General syntax radui [options] 1. Serving & Runtime (6 Commands) radui run [app.py] [--port 3000]: Start standard ASGI production server. radui dev [app.py] [--port 3000] [--open]: Start development server with file watching and automatic browser reload on change. radui serve [app.py] [--workers 4]: Start multi-worker production cluster with process management. radui demo: Launch the interactive RADUI Guided Tour on port 3000 without configuration. radui stop [--port 3000]: Terminate running RADUI server processes listening on a designated port. radui restart [app.py]: Gracefully restart a running RADUI application instance. 2. Project Scaffolding & Setup (6 Commands) radui new [--template architecture|dashboard|agent|basic]: Generate a new starter application. radui init: Initialize RADUI configuration within an existing project directory. radui add : Install optional capability modules (mcp, langgraph, analytics, server). radui upgrade: Upgrade RADUI and dependency packages to the latest release. radui version: Print framework version and Python runtime release. radui info: Display operating system, ASGI server, and environment configuration. 3. Quality, Auditing & Diagnostics (7 Commands) radui check [app.py]: Execute static pre-flight component and route linting. radui audit [app.py] --a11y: Run automated static accessibility diagnostics (validates heading hierarchies, form labels, interactive button descriptions, contrast tokens, and live regions). radui test: Execute application pytest test suite. radui lint [app.py]: Validate Application IR schemas and component bindings. radui validate [app.py]: Verify state context bindings and command identifiers. radui security [app.py]: Audit cookie flags, CSRF tokens, and secret persistence. radui doctor: Diagnose local system health, port 3000 availability, and installed packages. 4. Build & Distribution (6 Commands) radui build [app.py]: Compile and package production distribution artifacts into ./dist. radui bundle [app.py]: Bundle application code and local static assets. radui export [app.py] --static: Pre-render pages into standalone zero-server HTML document bundles. radui assets: Inspect embedded static assets footprint (~37.6 KB JS raw / ~9.6 KB gzip). radui clean: Remove generated artifacts, test caches, and __pycache__ directories. radui deploy: Generate containerized production Dockerfiles and deployment manifests for cloud preparation. 5. Inspection, Telemetry & Profiling (10 Commands) radui routes [app.py]: List all registered routes, command handlers, and background jobs. radui components: Display catalog of all 68 built-in components grouped by domain. radui tree [app.py]: Render visual ASCII tree of route and component hierarchies. radui inspect: Open runtime telemetry inspector in browser (Ctrl+Shift+I). radui schema: Output Application IR JSON schema definition. radui metrics [--benchmark]: Display real-time throughput, latency, and memory consumption, or run the 6-tier benchmark harness. radui telemetry: Export runtime telemetry spans and execution traces. radui profile: Profile component rendering and command dispatch latencies. radui health: Execute runtime readiness and liveness health checks. radui events: Monitor live EventBroker SSE stream records and sequences. 6. State & Background Subsystems (4 Commands) radui state: Inspect active reactive state scopes and registered keys. radui jobs: Inspect background job queue statuses and active leases. radui config: Inspect and validate active application configuration settings. radui secrets: Audit environment variables and session secret configurations. 7. AI & Protocols (6 Commands) radui agent: Inspect registered AI agent adapters and tools. radui mcp: Inspect Model Context Protocol tools and schemas. radui protocols: Audit supported frontend protocols (SSE, A2UI, AG-UI). radui a2ui: Validate and test Agent-to-UI component conversion pipelines. radui agui: Inspect and stream AG-UI event journal sequences. radui tools: List all registered tool descriptors available for agent dispatch. Framework Architecture Comparison Matrix Architectural Feature RADUI Streamlit Reflex NiceGUI Next.js / React Language Pure Python Python Python Python TypeScript / JS JS Build Toolchain Zero (0 npm) Zero Node.js required Zero Node.js required Execution Model Surgical SSE Patching Script re-run Full virtual DOM WebSocket DOM Client Virtual DOM AST Compilation Latency 0.039 ms N/A (Script run) ~150-300 ms ~10-30 ms ~50-200 ms State Scoping 5 Deterministic Tiers Session / Ephemeral State classes Client/Global React Context / Hooks Split-Brain Protection Monotonic Fencing None None None Database locks Streaming Generative UI Built-in (A2UI/AG-UI) Unsupported Custom wrappers Custom wrappers Vercel AI SDK Client Bundle Size ~9.6 KB gzip ~2.5 MB ~1.2 MB ~800 KB ~150-500 KB Distributed Jobs Engine ACID SQLite / Redis None Celery setup Background tasks BullMQ / Inngest Architectural Decision Records (ADRs) RADUI development strictly adheres to 12 formal, immutable Architecture Decision Records:
Q: How does RADUI prevent split-brain issues in multi-node clusters? RADUI implements Monotonic Fencing Tokens (ADR-001). Every state mutation lease and distributed background job acquisition receives an incremented 64-bit integer token. If a worker pauses (e.g. GC pause or network partition) and its lease expires, a new worker acquires the lease with an incremented token. When the old worker wakes up, any write carrying the stale token is rejected with StaleLeaseError. Q: How do I test RADUI applications without spinning up a browser? Use the built-in radui.testing.TestHarness: from radui.testing import TestHarness import radui as ui def test_button(): app = ui.App("Test") harness = TestHarness(app) tree = ui.card(ui.heading("Welcome"), ui.button("Submit")) html = harness.render_component(tree) assert "Welcome" in html License & Governance RADUI is released as an open-source project under the Apache License 2.0.
Both files in this release have provenance metadata.
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 15, 2026.
Both files in this release have been uploaded with provenance metadata.
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.




