Unified AI workspace: text chat, voice, images, files, web search, long-term memory, deep research, presentation generation, and automatic model routing — all powered by the MWS GPT API.
Quick start for judges / first-time setup → QUICKSTART.md (bilingual EN/RU)
One-command Docker boot, no Python / Node / Postgres needed on the host.
backend/ Python backend (FastAPI)
app/
config.py Settings & environment variables
application.py FastAPI app factory
db/
base.py SQLAlchemy Base + TimestampMixin
session.py Async session & get_db_session dependency
models/ ORM models (User, Conversation, Message, Memory, File, FileChunk)
dao/ Data access layer (GenericDAO + per-entity DAOs)
services/ Business logic (Chat, Memory, Audio, Image, Embedding, Model, Conversation)
schemas/ Pydantic request/response models
web/
api/ API routers (chat, conversations, audio, images, files, web, memory, models)
error_handlers.py
alembic/ Database migrations
tests/ pytest suite
Dockerfile
pyproject.toml Dependencies & tool config (ruff, pytest)
main.py Uvicorn entrypoint
ml/ ML intelligence layer
router.py 3-stage model router (attachment -> heuristic -> LLM)
prompt_engine.py Jinja2 template engine for system prompts
context_manager.py Token budgeting & context window packing
pipelines/ Pipeline configs (ASR, VLM, ImageGen, RAG)
prompts/ Jinja2 templates (text_chat, code, vlm, rag, web_search, etc.)
frontend/ OpenWebUI fork (git submodule)
docs/ Feature specs per branch
backend/ Backend feature docs (01-chat-proxy .. 11-deep-research)
frontend/ Frontend feature docs (01-text-chat .. 12-deep-research)
ml/ ML feature docs (01-model-router .. 10-deep-research)
docker-compose.yml Full stack: backend + frontend + PostgreSQL (pgvector) + Redis
- Docker & Docker Compose
- MWS GPT API key
cp .env.example .env
# Edit .env — set MWS_GPT_API_KEY=sk-your-key
docker compose up --build- Frontend UI: http://localhost:3000
- Backend API docs: http://localhost:8000/api/docs
Database migrations and the default user are applied automatically by the backend container's entrypoint — no manual alembic step needed.
For a step-by-step guide (incl. Russian version, troubleshooting, and feature walk-through) see QUICKSTART.md.
cd backend
# Create venv & install
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# Start PostgreSQL + Redis (via docker-compose or locally)
docker-compose up postgres redis -d
# Run migrations
alembic upgrade head
# Start server
python main.pyThe frontend is an OpenWebUI fork. See frontend-overrides/INTEGRATION.md for how to wire it to our backend.
| Layer | Stack |
|---|---|
| Backend | Python 3.12, FastAPI, SQLAlchemy 2.0, asyncpg, pgvector, httpx, Alembic |
| ML | Jinja2, tiktoken, regex-based + LLM classifier routing |
| Frontend | Svelte (OpenWebUI), TailwindCSS |
| Database | PostgreSQL 16 + pgvector |
| Cache | Redis 7 |
| Infra | Docker, docker-compose |
| Endpoint | Method | Purpose |
|---|---|---|
/api/chat/completions |
POST | Chat with SSE streaming |
/api/chats |
GET/POST | List / create conversations |
/api/chats/{id} |
GET/PUT/DELETE | Conversation CRUD |
/api/audio/transcribe |
POST | Voice recording ASR |
/api/audio/upload |
POST | Audio file ASR |
/api/images/generate |
POST | Image generation |
/api/files/upload |
POST | File upload + RAG indexing |
/api/files |
GET | List uploaded files |
/api/web/search |
POST | Web search |
/api/web/parse |
POST | URL content parsing |
/api/memory |
GET/POST | List / create memories |
/api/memory/{id} |
PUT/DELETE | Memory CRUD |
/api/models |
GET | Available models by category |
Frontend (OpenWebUI)
|
| HTTP / SSE
v
Backend (FastAPI)
|
+-- Model Router (ML) --> selects model + builds prompt
+-- Memory Service -----> pgvector similarity search
+-- File Service -------> text extraction + RAG embedding
+-- Web Service --------> search + URL parsing
|
v
MWS GPT API (api.gpt.mws.ru/v1/)
- /chat/completions (text, VLM)
- /embeddings (bge-m3)
- /images/generations
- /audio/transcriptions
| Directory | Owner | Scope |
|---|---|---|
backend/ |
Backend engineer | API, DB, services, Docker |
ml/ |
ML engineer | Routing, prompts, context, pipelines |
frontend/ |
Frontend engineer | OpenWebUI modifications |