Skip to content

OpenAI endpoint stage 08 — production controls

Choose a tag to compare

Stage 8 of the OpenAI-compatible endpoint branch.

Implemented:

  • Added optional HTTP API-key authentication, separate from DRIFT's node-to-node DRIFT_NETWORK_KEY wire security.
  • Accepted API keys through --api-key, DRIFT_API_KEY, Bearer auth, and X-API-Key.
  • Added optional CORS configuration through --cors-origin and DRIFT_CORS_ORIGINS.
  • Added /ready readiness metadata with context length and capability flags.
  • Added DRIFT_SERVE_HOST, DRIFT_SERVE_PORT, --max-concurrent-requests, and --no-access-log server controls.
  • Added a shallow HTTP concurrency middleware while preserving the backend generation lock.
  • Added tests for auth failures/successes, unauthenticated readiness, and CORS preflight behavior.

Verification:

  • python3 -m pytest tests/test_openai_api.py tests/test_sampling_controls.py -q (23 passed, 1 skipped because local Python lacks torch)
  • python3 -m compileall drift tests
  • python3 -m drift.cli serve --help