Web Workbench HTTP API¶
cc4q serve starts a Starlette/Uvicorn server that serves the single-page
Workbench UI and a JSON API. The browser UI is served by the same app and
drives a subset of these routes; every route is also usable from scripts
and notebooks.
Starlette/Uvicorn backend for the redesigned CC4Q Workbench.
Provides a fast, zero-flicker JSON API and serves the modern single-page Web
Workbench UI under cc4q/web/static/. Focuses exclusively on Quantum-Specific
comment analysis (Binary Quantum-Relatedness + 6-Category Quantum Knowledge
Taxonomy), interactive data labeling (Annotation Studio), and in-tool model
training & evaluation.
- cc4q.web.server.run_server(host='127.0.0.1', port=8501)[source]¶
Serve the Workbench with Uvicorn (blocking).
- Parameters:
host – Interface to bind, e.g.
"127.0.0.1"for local use or"0.0.0.0"in a container.port – TCP port.
The ASGI application is available as
cc4q.web.server.appfor embedding in another ASGI server. HTTP routes are documented in Web Workbench HTTP API.
The ASGI application is available as cc4q.web.server.app, and the route
list as cc4q.web.server.routes, for embedding in another ASGI server.
The cc4q.web package also exposes WEB_DIR (package directory),
STATIC_DIR (single-page UI assets), and DATA_DIR (precomputed demo
corpora).
Endpoints¶
Method |
Path |
Purpose |
|---|---|---|
|
|
Workbench single-page UI. |
|
|
Manifest, corpora, model status, code presets, taxonomy, annotation count. |
|
|
Paginated/filterable SCCU units. Query parameters: |
|
|
Download the corpus as JSONL. |
|
|
Delete a non-built-in corpus asset. |
|
|
Analyze a code snippet. Body: |
|
|
Start a repository build job. Body: |
|
|
Poll build progress (stage, progress, status, error). |
|
|
List annotation sessions. |
|
|
Create a session. Body: |
|
|
Session metadata, items, and live agreement metrics. |
|
|
Store one human label. Body: |
|
|
Export annotations. Query parameter |
|
|
Delete a session. |
|
|
Registered user models, training sources, and training jobs. |
|
|
Set the active model. Body: |
|
|
Start fine-tuning. Body: |
|
|
Poll training progress (stage, step, history, test results). |
|
|
Delete a user model package. |
|
|
Download a user model package as a zip. |
|
|
Compare two models on a corpus. Body: |
Examples¶
Start the server and inspect the overview:
cc4q serve --host 127.0.0.1 --port 8501
curl -s http://127.0.0.1:8501/api/overview | python -m json.tool
Analyze a snippet:
curl -s -X POST http://127.0.0.1:8501/api/inspect \
-H 'Content-Type: application/json' \
-d '{"code": "def f(qc):\n # Apply a Hadamard gate\n qc.h(0)\n"}'
Note
Pipeline and training jobs run in background threads and are polled
through their /jobs/{job_id} endpoints. The server keeps jobs in
memory, so a restart clears completed/running job history.