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

3

u/Puzzleheaded_Clerk68 Jan 25 '26

I'm actually a huge fan of NiceGUI myself!

However, there were two specific hurdles that led me to build Violit:

  1. Design Flexibility: NiceGUI is tightly coupled with Quasar, which makes it difficult to break out of the standard 'Material Design' look or apply custom CSS freely. I wanted a framework that allows for more unique, custom UI designs without fighting the defaults.
  2. Target Audience: Violit specifically targets AI Engineers & Data Scientists, not professional software engineers. For this audience, the linear, scripting-style syntax (like Streamlit) is much more intuitive for building rapid MVPs.

Since user feedback strongly favored the 'Streamlit experience' over NiceGUI's paradigm, I decided to build a tool that keeps that familiar syntax but improves the performance.

Thanks for asking!

2

u/bugtank Jan 25 '26

Great response. Maybe will give it a shot.