Overview
Hugging Face exposes two deployment targets that Cognisafe can intercept:- Text Generation Inference (TGI) — self-hosted inference server, OpenAI-compatible API on
/v1/ - Inference Endpoints — managed hosting on HF infrastructure, also OpenAI-compatible
UPSTREAM_URL at your TGI instance or Inference Endpoint URL.
Text Generation Inference (self-hosted)
TGI exposes an OpenAI-compatible endpoint athttp://<host>:8080/v1 by default.
Docker deployment
Proxy configuration
SDK setup
TGI serves one model at a time. The
model field in the request is ignored — TGI always responds with the model it was started with.Hugging Face Inference Endpoints (managed)
Inference Endpoints expose a URL likehttps://xyz.us-east-1.aws.endpoints.huggingface.cloud.
Proxy configuration
SDK setup
Authorization: Bearer hf_... header to the Inference Endpoint unchanged.
Air-gapped scoring
In air-gapped environments, point the safety worker’s scoring model at a local TGI instance:Kubernetes deployment
UPSTREAM_URL=http://tgi.default.svc.cluster.local:8080 on the Cognisafe proxy deployment.
