| Crates.io | attuned-http |
| lib.rs | attuned-http |
| version | 1.0.1 |
| created_at | 2025-12-18 17:39:58.121082+00 |
| updated_at | 2025-12-18 19:42:27.485449+00 |
| description | HTTP reference server for Attuned |
| homepage | |
| repository | https://github.com/JtPerez-Acle/Attuned |
| max_upload_size | |
| id | 1992984 |
| size | 91,464 |
HTTP reference server for Attuned.
Production-ready HTTP server built with Axum providing:
use attuned_http::{Server, ServerConfig, AuthConfig};
use attuned_store::MemoryStore;
use std::sync::Arc;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ServerConfig {
host: "127.0.0.1".to_string(),
port: 8080,
auth: AuthConfig::None,
..Default::default()
};
let store = Arc::new(MemoryStore::new());
let server = Server::new(config, store);
server.run().await?;
Ok(())
}
| Method | Path | Description |
|---|---|---|
| POST | /v1/state |
Upsert state (patch semantics) |
| GET | /v1/state/{user_id} |
Get latest state |
| GET | /v1/context/{user_id} |
Get translated PromptContext |
| DELETE | /v1/state/{user_id} |
Delete state (GDPR) |
| POST | /v1/translate |
Translate arbitrary state |
| GET | /health |
Health check |
| GET | /ready |
Readiness check |
| GET | /metrics |
Prometheus metrics |
# Set user state
curl -X POST http://localhost:8080/v1/state \
-H "Content-Type: application/json" \
-d '{"user_id": "user_123", "axes": {"cognitive_load": 0.8}}'
# Get context for LLM
curl http://localhost:8080/v1/context/user_123
// API Key auth
AuthConfig::ApiKey { key: "secret".to_string() }
// Bearer token
AuthConfig::Bearer { secret: "jwt-secret".to_string() }
// No auth (development only)
AuthConfig::None
Apache-2.0