# Repository Briefing: wandb/openui
> Source: https://repoforai.com/repo/wandb/openui (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/wandb/openui
- **Official Docs / Website**: https://openui.fly.dev
- **Category**: Chat UI & AI Apps (聊天界面与 AI 应用)
- **Primary Language**: TypeScript
- **License**: Apache-2.0
- **Engineering Health**: A (79/100 · Maintenance 31/35 · Adoption 22/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: Docker, Self-Hosted, Local AI
- **Momentum**: 22,811 ★ total (+7 24h / +45 7d) · 2,073 forks
- **Topics**: `ai`, `generative-ai`, `html-css-javascript`, `tailwindcss`
- **When to Use**: Best for: Design and frontend teams prototyping UI components from prompts, especially when they want to reuse a local or OpenAI-compatible inference service and refine the generated code themselves. Skip if: You want a polished managed workflow with no model operations, or need generated components to meet production standards without engineering review.

## Overview
```text
### Architecture & Core Mechanics
OpenUI pairs a TypeScript browser frontend in `frontend/` with a Python backend in `backend/`, launched through `python -m openui`. The browser is where users describe a UI, inspect the rendered output, and request revisions. The backend connects that workflow to the selected inference service rather than tying the application to one model runtime.

The integration boundary is model routing. OpenUI connects to Ollama over HTTP through OLLAMA_HOST and can derive LiteLLM configuration from environment variables. A custom `litellm-config.yaml` in the working directory, `/app/litellm-config.yaml` in Docker, or a file designated by OPENUI_LITELLM_CONFIG can override that configuration. This lets operators change model endpoints without rewriting the preview workflow.

### Key Capabilities & Differentiators
The core workflow is to generate a UI from a natural-language brief, inspect it in a live preview, and revise it through follow-up requests. OpenUI can convert generated HTML into React, Svelte, or Web Components. These outputs are useful starting points for component implementation, not evidence of a complete application build pipeline.

Inference options include OpenAI and Groq, providers such as Anthropic and Gemini through LiteLLM, and models served by Ollama. An OpenAI-compatible endpoint can be added under LiteLLM and surfaced in the model selector, allowing teams to reuse an existing inference server. LLaVA is an example of an image-capable Ollama model; image support should not be assumed for every selectable model.

### Trade-offs & Limitations
Compared with v0, OpenUI trades a more polished managed experience for control over hosting and inference. A hosted provider avoids local GPU provisioning but introduces API charges and an external boundary for prompt data. Ollama can keep inference local once the model is provisioned, but the operator takes responsibility for model storage, memory sizing, and throughput. Self-hosting just the frontend and backend does not make cloud inference local.

The default Compose setup may be slow for local generation. GPU acceleration may require a different Ollama image tag and a compatible host setup; on Apple Silicon, running Ollama natively is the practical option. Before adopting the export workflow, test representative components for responsive behavior, accessibility, and compatibility with your framework and design system. A successful preview alone does not establish that the output is ready to merge.

### Hardware & Deployment Guide
The published `ghcr.io/wandb/openui` image is the shortest path to a running instance on port 7878. Forward only the credentials required by your provider or set OLLAMA_HOST to a reachable instance. The root `docker-compose.yaml` can run both services, connects OpenUI to `http://ollama:11434`, and persists Ollama models. The Compose file publishes the Ollama port as well; restrict it if clients outside the Docker network do not need direct access.

For a source install, use Git and uv, run `uv sync --frozen --extra litellm` in `backend/`, then launch `python -m openui` from the activated environment. The development workflow runs `python -m openui --dev` alongside `npm run dev` in `frontend/`, with the development UI on port 5173. A local inference setup still needs model files provisioned up front. No formal release milestone is listed; record the tested commit and container digest rather than treating `latest` as a reproducible version.
```

## Key Capabilities
```text
- Generation loop: Generate from a natural-language brief, preview the rendered UI, and request changes in the same workflow.
- Conversion targets: Turn generated HTML into React, Svelte, or Web Components for downstream integration.
- Provider routing: Use OpenAI, Groq, Ollama, or LiteLLM; OpenAI-compatible models appear under LiteLLM in the model selector.
- Configuration override: Replace the environment-derived LiteLLM configuration with `litellm-config.yaml` or a path set through OPENUI_LITELLM_CONFIG.
- Container topology: Compose serves OpenUI on port 7878 and connects to Ollama at `http://ollama:11434`, with persistent model storage at `/root/.ollama`.
- Development loop: Run `python -m openui --dev` and the frontend's `npm run dev` separately; use port 5173 for the live-reloading development UI.
```

## Quick Start / Clone
```bash
export ANTHROPIC_API_KEY=xxx
export OPENAI_API_KEY=xxx
docker run --rm --name openui -p 7878:7878 -e OPENAI_API_KEY -e ANTHROPIC_API_KEY -e OLLAMA_HOST=http://host.docker.internal:11434 ghcr.io/wandb/openui
```
