OpenAI endpoint stage 07 — embeddings and capabilities
Stage 7 of the OpenAI-compatible endpoint branch.
Implemented:
- Added model capability metadata to
/v1/modelsfor chat, completion, and embedding support. - Added
POST /v1/embeddingswith OpenAI-shaped embedding responses and usage accounting. - Added embedding input normalization for strings, string arrays, token-id arrays, and arrays of token-id arrays.
- Added
encoding_format: floatandencoding_format: base64support. - Added a non-thin DRIFT embedding implementation that routes the prompt through the existing split pipeline and pools the final hidden state.
- Added explicit
unsupported_embeddingserrors for modes such as thin-head where hidden-state embeddings cannot be produced at the head. - Added tests for model capabilities, float embeddings, base64 embeddings, token-id embedding inputs, and unsupported embedding mode errors.
Verification:
python3 -m pytest tests/test_openai_api.py tests/test_sampling_controls.py -q(20 passed, 1 skipped because local Python lacks torch)python3 -m compileall drift tests