r/FastAPI • • Jan 24 '26

pip package I built "Violit": A High-Performance UI Framework powered by FastAPI & Signals (O(1) reactivity without reruns)

Hi everyone,

I’m a huge fan of the FastAPI ecosystem. While I love FastAPI for its performance, I’ve always struggled to find a Python UI framework that matches its "async-first" speed without the developer friction.

Streamlit is great for prototyping, but the "full script rerun" on every interaction is a performance bottleneck. So, I built Violit. It’s an open-source framework that uses FastAPI as the core engine to deliver a Streamlit-like DX but with O(1) signal-based reactivity.

Demo

Why FastAPI?

I chose FastAPI because I wanted Violit to be production-ready and async-native from day one.

  • State over WebSockets: Violit maintains a persistent connection via FastAPI’s WebSocket implementation. When a state (Signal) changes, only the specific component updates—no page refreshes or full script reruns.
  • Async-First: Since it’s built on FastAPI, it handles asynchronous tasks (like AI inference or DB queries) without blocking the UI. (This feature will be updated soon.)
  • High Throughput: By leveraging Uvicorn/Starlette under the hood, it scales far better than traditional "rerun-based" frameworks.

Key Features

  • Zero Rerun Architecture: Pure O(1) state updates.
  • 90% Streamlit Compatibility: If you know Streamlit, you already know Violit.
  • Shoelace Web Components: Modern, accessible UI elements.
  • 30+ Built-in Themes: Switch from "Cyberpunk" to "Dracula" with one line: app.theme('dracula').
  • Native Mode: Package your FastAPI-based web app into a desktop app with --native.

Simple Example

import violit as vl
​
app = vl.App()
count = app.state(0) # Reactive Signal
​
# No full script rerun! 
# FastAPI handles the WebSocket message and updates only the label.
app.button("Increment", on_click=lambda: count.set(count.value + 1))
app.write("Current Count:", count)
​
app.run()

Feedback Wanted!

As a fellow FastAPI user, I’d love to hear your thoughts on the architecture. Is there anything you'd like to see in a "FastAPI-based frontend" framework?

I’m currently in early Alpha (v0.0.2) and looking for contributors and feedback to make Python web development even faster!

53 Upvotes

18 comments sorted by

View all comments

Show parent comment

4

u/Puzzleheaded_Clerk68 Jan 25 '26

To clarify, Violit is designed as a standalone full-stack framework for building entire apps in pure Python, rather than just a frontend layer for existing backends.

The reason I shared it in this channel is because Violit's core engine is built on FastAPI. I wanted to highlight that it relies on FastAPI's robust and high-performance architecture under the hood.

Thanks for asking..!!

2

u/DynamicBR Jan 25 '26

Ah, I understand, thank you very much!