OpenAI endpoint stage 08 — production controls
Stage 8 of the OpenAI-compatible endpoint branch.
Implemented:
- Added optional HTTP API-key authentication, separate from DRIFT's node-to-node
DRIFT_NETWORK_KEYwire security. - Accepted API keys through
--api-key,DRIFT_API_KEY, Bearer auth, andX-API-Key. - Added optional CORS configuration through
--cors-originandDRIFT_CORS_ORIGINS. - Added
/readyreadiness metadata with context length and capability flags. - Added
DRIFT_SERVE_HOST,DRIFT_SERVE_PORT,--max-concurrent-requests, and--no-access-logserver 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 testspython3 -m drift.cli serve --help