Deploy Poimen Memory K8s cluster with ArgoCD tracking (M2.2, M3.5-M3.7)
ci / markdown (push) Waiting to run
ci / markdown (push) Waiting to run
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|---|---|
|
||||
| Phase | M1 — Gated loop at L1 |
|
||||
| Size | M — 1–3 days |
|
||||
| Status | ⬜ Not started |
|
||||
| Status | ✅ Done |
|
||||
| Flags | — |
|
||||
| Spec | inlined below |
|
||||
| Blocks | M0.1 |
|
||||
@@ -14,6 +14,69 @@
|
||||
Talk to the homelab gateway, with the two non-obvious details that cost a day to
|
||||
find already baked in.
|
||||
|
||||
## Files
|
||||
|
||||
| Action | Path |
|
||||
|---|---|
|
||||
| Create | `crates/mem-llm/src/chat.rs` — `ChatClient`, `Completion`, `Usage` |
|
||||
| Replace | `crates/mem-llm/src/lib.rs` — replace `pub mod placeholder {}` with `pub mod chat;` + re-exports |
|
||||
| Create | `tests/it_chat_client.rs` — integration tests (workspace root, matches existing convention) |
|
||||
| Modify | `Cargo.toml` root — add `wiremock = "0.6"` to `[dev-dependencies]` |
|
||||
|
||||
## Dependencies
|
||||
|
||||
| Crate | Where | Already present? |
|
||||
|---|---|---|
|
||||
| `reqwest` (json feature) | `crates/mem-llm/Cargo.toml` | ✅ yes |
|
||||
| `serde`, `serde_json` | `crates/mem-llm/Cargo.toml` | ✅ yes |
|
||||
| `tokio` | `crates/mem-llm/Cargo.toml` | ✅ yes |
|
||||
| `anyhow`, `thiserror` | `crates/mem-llm/Cargo.toml` | ✅ yes |
|
||||
| `wiremock = "0.6"` | root `Cargo.toml` `[dev-dependencies]` | ❌ add |
|
||||
|
||||
## Existing code
|
||||
|
||||
- `crates/mem-llm/src/lib.rs` is an empty placeholder — replace entirely
|
||||
- No existing HTTP client code to reuse; build from scratch
|
||||
- `crates/mem-core/src/lesson.rs` has an unrelated events JSONL writer — ignore it here
|
||||
|
||||
## API shape
|
||||
|
||||
```http
|
||||
POST https://api.riotpiao.com/v1/qwen/chat/completions
|
||||
|
||||
Headers:
|
||||
apikey: <value of MEM_API_KEY env var>
|
||||
Content-Type: application/json
|
||||
|
||||
Body (note: NO "tools" key — not even an empty array):
|
||||
{
|
||||
"model": "qwen2.5:3b-instruct",
|
||||
"messages": [
|
||||
{"role": "system", "content": "<system prompt>"},
|
||||
{"role": "user", "content": "<user prompt>"}
|
||||
],
|
||||
"max_tokens": 2048
|
||||
}
|
||||
|
||||
Response 200:
|
||||
{
|
||||
"choices": [
|
||||
{"message": {"role": "assistant", "content": "<model output>"}}
|
||||
],
|
||||
"usage": {
|
||||
"prompt_tokens": 1234,
|
||||
"completion_tokens": 567,
|
||||
"total_tokens": 1801
|
||||
}
|
||||
}
|
||||
|
||||
Response 401 (wrong auth header):
|
||||
{"message": "Unauthorized"}
|
||||
|
||||
Response 400 (body too large or malformed):
|
||||
{"error": {"message": "[] is too short - 'messages'"}}
|
||||
```
|
||||
|
||||
## Facts (inlined — no spec read needed)
|
||||
|
||||
```
|
||||
@@ -84,7 +147,7 @@ live gateway.
|
||||
6. `a6_live_smoke` — `#[ignore]`; real gateway, `qwen2.5:3b-instruct`, prompt
|
||||
"reply with exactly: pong", assert the text contains `pong`.
|
||||
|
||||
**Command:** `cargo test -p mem-llm chat_client` (add `-- --ignored` for a6)
|
||||
**Command:** `cargo test --test it_chat_client` (add `-- --ignored` for a6)
|
||||
|
||||
**False pass:**
|
||||
- Testing only against the mock. The mock accepts whatever header you send it;
|
||||
|
||||
Reference in New Issue
Block a user