HTTP Server
When the `server` feature is enabled, `forgetless-server` exposes a multipart API on port `8080` with `POST /` and `GET /health`.
Start the server
1cargo run --features server --bin forgetless-server
The server uses Axum, enables permissive CORS through `tower-http`, and raises the multipart body limit to 50 MB.
Request shape
| Field | Type | Meaning |
|---|---|---|
| metadata | JSON string | Contains `max_tokens`, optional `query`, and inline text contents. |
| file | Multipart file | Uploaded with medium priority. |
| file:critical | Multipart file | Uploaded with critical priority. |
| file:high | Multipart file | Uploaded with high priority. |
| file:low | Multipart file | Uploaded with low priority. |
1{2 "max_tokens": 128000,3 "query": "Summarize the main architectural changes",4 "contents": [5 { "content": "You are preparing release notes.", "priority": "critical" },6 { "content": "Keep the answer short.", "priority": "high" }7 ]8}
Response shape
1{2 "content": "## system.md\nInstructions...\n\n---\n\n## review.pdf\nKey findings...",3 "total_tokens": 45211,4 "compression_ratio": 2.79,5 "stats": {6 "input_tokens": 126000,7 "output_tokens": 45211,8 "chunks_processed": 89,9 "chunks_selected": 32,10 "processing_time_ms": 125011 }12}