Add uv packaging, env-driven Django settings, OLLAMA_BASE_URL (LAN GPU host), DatabaseStorage for prompt/document blobs, compose/CI/deploy workflows mirroring scha, and ASGI gunicorn+UvicornWorker for WebSockets.
39 lines
930 B
Markdown
39 lines
930 B
Markdown
# Chat Backend
|
|
|
|
Django + Channels API for AIML Operations chat (`llm_be/`).
|
|
|
|
## Local (uv)
|
|
|
|
```bash
|
|
cp .env.example .env
|
|
uv sync
|
|
cd llm_be
|
|
uv run python manage.py migrate
|
|
uv run python manage.py runserver 0.0.0.0:8003
|
|
```
|
|
|
|
## Docker (dev compose = bundled Postgres)
|
|
|
|
```bash
|
|
docker compose up --build
|
|
```
|
|
|
|
Prod compose (`docker-compose.prod.yml`) expects external `DATABASE_URL` and
|
|
`WEB_PORT` from server-infra secrets. See `.env.prod.example`.
|
|
|
|
## Ollama
|
|
|
|
Set `OLLAMA_BASE_URL` (default `http://127.0.0.1:11434` locally).
|
|
Deployed envs use the GPU host: `http://10.0.0.128:11434`.
|
|
|
|
## File storage
|
|
|
|
Prompt attachments and documents are stored in Postgres (`StoredFile` /
|
|
`DatabaseStorage`), not on the container filesystem.
|
|
|
|
## Deploy
|
|
|
|
Gitea Actions on `master` → `server-infra/scripts/deploy.sh --app chat_backend --env prod`.
|
|
|
|
Related: [chat_backend#6](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/6)
|