|
Download docs/service.md from Giuliocc/doxa-methods: direct link, hf CLI and curl.
- Browser
- Download file 2.19 kB
-
https://huggingface.co/datasets/Giuliocc/doxa-methods/resolve/main/docs/service.md
- Command line
-
hf download hf://datasets/Giuliocc/doxa-methods/docs/service.md
-
curl -L -o service.md https://huggingface.co/datasets/Giuliocc/doxa-methods/resolve/main/docs/service.md
2.19 kB
| # DOXA service contract | |
| Run the development prototype on the same machine as the client. | |
| ```sh | |
| python tools/service.py --model model.json --port 9010 | |
| curl http://127.0.0.1:9010/health | |
| curl -H 'Content-Type: application/json' http://127.0.0.1:9010/v1/predict \ | |
| -d '{"claim_type":"budget","text":"The director said the repair grant covered the listed buildings.","context":"The publication reports the director’s statement. Payment logs were not supplied."}' | |
| ``` | |
| - `GET /health` returns service, methods and model revision. | |
| - `POST /v1/predict` takes `claim_type`, `text` and optional `context`. | |
| Scope is analyst-supplied. Unknown scope or ordinary advocacy can be | |
| out of scope. Each segment permits 6,000 Unicode characters. | |
| - `POST /v1/scorecard` accepts an object with `pairs`. It applies fixed | |
| matching and bounds to 1–200 supplied pairs. Labels are treated as | |
| supplied annotations with unverified provenance. It does not convert | |
| predictions into empirical results. | |
| - Invalid input can return 400, long bodies 413, and non-JSON 415. | |
| Responses use `Cache-Control: no-store`. This prototype binds to | |
| loopback, writes no request logs and persists no input. | |
| - A returned evidence quote is an extractive model candidate. The quote | |
| matches its segment at the given code-point offsets. The model makes | |
| no independent fact finding or assessment of a person's beliefs. | |
| ## Deployment on doxa.tacitus.me | |
| Keep retrieval, inference, aggregation and reviewer approval distinct. | |
| Store model and measure revisions with every decision. Production use | |
| requires authenticated API access, TLS, tenant authorization, managed | |
| secret storage, privacy and retention decisions, request budgets, deletion, | |
| monitoring and independently reviewed real-domain evaluation. Acceptable | |
| use covers textual review, criticism and appeal. Prejudicial language | |
| rubrics and publication policies need domain approval. | |
| Use a held-out set and monitor error by genre, topic and source when | |
| considering a rollout. Perform load, abuse and cross-tenant isolation | |
| tests before production. The public Static Space runs inspection in the | |
| browser. The local Python service remains a development interface. | |