Adapters
Deprecated: HuggingFace TGI serving engine
HuggingFace Text Generation Inference (TGI) is in maintenance mode upstream. New deployments should use vLLM or SGLang. The Bigwave adapter (packages/serving/adapters/tgi.py) is preserved for migration parity but will be removed in v1.0; constructing the engine now emits a DeprecationWarning. This applies to the serving adapter axis only — the LoRA adapter registry documented on this page is unaffected.
Workspace-scoped CRUD over the LoRA adapter registry. Adapter rows are created by the training pipeline calling AdapterRegistry.register directly with the artifact emitted by the training backend; the admin surface is read-and-delete only by design — exposing a public POST would let callers register adapters that were never trained through the platform, which breaks the dataset_sha → adapter_id provenance chain (PRD 04 NFR-6).
The router lives at packages/training/registry_routes.py.
Endpoints
| Method | Path | Auth | Summary |
|---|---|---|---|
| GET | /admin/adapters/ | Bearer | List workspace adapters; optional base_model filter. |
| GET | /admin/adapters/{adapter_id} | Bearer | Fetch one adapter; 404 if missing or cross-tenant. |
| DELETE | /admin/adapters/{adapter_id} | Bearer | Delete an adapter; 204 on success. |
GET /admin/adapters/
Returns a JSON array of AdapterRecord (packages/training/registry.py:52) objects ordered by creation time. Pass ?base_model=meta-llama/Llama-3.1-8B to filter.
Response item shape:
{
"adapter_id": "adp_01HF…",
"workspace_id": "default",
"base_model": "meta-llama/Llama-3.1-8B",
"dataset_sha": "sha256:…",
"hparams_hash": "h_…",
"eval_metrics": {"win_rate": 0.62},
"license": "MIT",
"artifact_uri": "file:///var/lib/bigwave/adapters/adp_01HF.bin",
"training_sha": "git_…",
"created_at": "2025-09-01T12:34:56Z"
}curl -H "Authorization: Bearer $BIGWAVE_ADMIN_TOKEN" \
"http://localhost:8000/admin/adapters/?base_model=meta-llama/Llama-3.1-8B"GET /admin/adapters/{adapter_id}
Returns a single AdapterRecord. Cross-tenant lookups return 404 with no oracle behaviour — workspace existence does not leak.
DELETE /admin/adapters/{adapter_id}
Removes the registry row. Local artifact bytes (file:// URIs) are best-effort cleaned up by AdapterRegistry.delete; remote artifacts (s3://, http(s)://) are left in place for the operator's object store lifecycle policy to reclaim.
Returns 204 No Content on success, 404 when the adapter does not exist or belongs to another workspace.
Operator notes
- No POST surface. Adapter creation is an outcome of training, not an operator action. See 05 — Train an adapter.
- Workspace fence. Both
GETandDELETEresolve the workspace from the bearer principal; the path-id alone never identifies an adapter. - Promotion vs deletion. Deleting an adapter does not unload it from a serving replica — drain it first via
POST /admin/models/{model_id}/adapterswith a differentadapter_id, or unload the model entirely. 503causes. TheAdapterRegistryis wired in lifespan in lifespan; routes return503with"AdapterRegistry not initialised"when the lifespan didn't complete. Check the API process logs for an earlier startup failure.- Related runbook. See docs/runbooks/feedback-loop.md for the end-to-end chat → feedback → DPO → adapter cycle.