Spaces:
Runtime error

File size: 1,521 Bytes
796f634
cc15101
 
 
 
796f634
cc15101
796f634
 
 
cc15101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: The Abyss
emoji: 🌀
colorFrom: purple
colorTo: green
sdk: docker
app_port: 7860
pinned: false
---

# The Abyss — backend (API)

FastAPI inference server for **Abyss-1**, a ~50M-parameter language model trained
from scratch (own byte-level BPE tokenizer; RoPE · RMSNorm · SwiGLU decoder),
with streaming chat + a ReAct agent, JWT user accounts, a self-hosted
safety/moderation layer, and sliding-window rate limiting.

This Space is **assembled by `deploy/hf-space/assemble.py`** in the project repo,
which stages `server/`, `ml/` (model + tokenizer) and `agent/` next to this
`Dockerfile`. The model weights are **pulled from the HF Hub at boot** (set
`ABYSS_HF_REPO`) rather than baked into the image.

## Configuration (Space → Settings)

**Variables**

- `ABYSS_HF_REPO` — HF model repo holding the checkpoint, e.g. `your-name/abyss-1`
- `ABYSS_HF_CHECKPOINT` — *(optional)* checkpoint filename (default `agent_ckpt.pt`)
- `ABYSS_CORS_ORIGINS` — *(optional)* comma-separated origin allowlist (default `*`)

**Secrets**

- `SECRET_KEY` — JWT signing key (use a long random value)
- `ABYSS_ADMIN_KEY` — unlocks `GET /v1/admin/moderation`

Leave `ABYSS_API_KEYS` **unset** to keep the API open to everyone.

## Endpoints

`GET /health` · `POST /auth/register` · `POST /auth/login` · `GET /auth/me` ·
`POST /v1/chat/completions` (SSE) · `POST /v1/agent/chat` (SSE) ·
`GET /v1/conversations` · `POST /v1/moderations`

See `DEPLOY.md` in the repository for the full step-by-step runbook.