Codexcoder commited on
Commit
0dd4bf4
·
verified ·
1 Parent(s): f563922

integration: add chat/README.md

Browse files
Files changed (1) hide show
  1. chat/README.md +56 -0
chat/README.md ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DeepSeek V4 Chat — Sovereign Conversational Core
2
+
3
+ > Model: **sovereign/deepseek-v4-sovereign** (304B MoE, sovereign-tuned,
4
+ > MIT lineage — see `models/deepseek-v4-sovereign/`)
5
+
6
+ ## Quick start
7
+
8
+ ```bash
9
+ # Local echo mode (no key needed)
10
+ python3 -c "
11
+ from chat.core import ChatSession, DeepSeekV4Client
12
+ s = ChatSession(); s.add('user', 'hello')
13
+ print(DeepSeekV4Client().complete(s)['content'][:80])
14
+ "
15
+
16
+ # API mode — set the key, then run the server
17
+ export DEEPSEEK_API_KEY=hf_or_ds_... # DeepSeek-compatible key
18
+ export DEEPSEEK_API_BASE=https://api.deepseek.com/v1
19
+ export DEEPSEEK_MODEL=sovereign/deepseek-v4-sovereign
20
+ uvicorn chat.api.app:app --host 0.0.0.0 --port 8003
21
+ # → POST /api/v1/chat/sessions · /send · GET /models · /status
22
+ ```
23
+
24
+ The router is also wired into `src/sovereign/main.py` (guarded) — the full
25
+ stack serves `/api/v1/chat/*`. Web UI: `site/chat.html`.
26
+
27
+ ## Env config
28
+
29
+ | Env | Default | Purpose |
30
+ |---|---|---|
31
+ | `DEEPSEEK_API_BASE` | `https://api.deepseek.com/v1` | OpenAI-compatible base URL |
32
+ | `DEEPSEEK_API_KEY` | *(unset)* | API key — unset ⇒ local echo mode |
33
+ | `DEEPSEEK_MODEL` | `sovereign/deepseek-v4-sovereign` | Model id |
34
+
35
+ ## API
36
+
37
+ | Method | Path | Purpose |
38
+ |---|---|---|
39
+ | POST | `/api/v1/chat/sessions` | Create a session |
40
+ | GET | `/api/v1/chat/sessions/{id}` | Session + history |
41
+ | POST | `/api/v1/chat/send` | Send message → reply (`{message, session_id, temperature?, max_tokens?}`) |
42
+ | GET | `/api/v1/chat/models` | Model registry |
43
+ | GET | `/api/v1/chat/status` | Mode / model / session count |
44
+
45
+ ## Tests
46
+
47
+ ```bash
48
+ .venv/bin/pytest tests/test_chat.py -q # 7 tests
49
+ ```
50
+
51
+ ## Honesty notes
52
+
53
+ - Local echo mode is deterministic and offline — a smoke test, not a model.
54
+ - The sovereign model card (304B MoE, GPTQ 4-bit) documents the
55
+ architecture; serving it at full scale requires the DeepSeek API or a
56
+ compatible runtime.