Skip to content

feat(server): OpenAI-compatible audio endpoints (TTS + STT) #363

Closed
3 of 3 issues completed
Closed

Description

@inureyes

Problem / Background

mlxcel-server does not expose the OpenAI audio API surface. It has no STT/TTS models and no audio-output path, so adding /v1/audio/* is a multi-part effort, not just route wiring.

Current mlxcel state

Reusable today:

  • WAV read: src/audio/feature_extractor.rs (load_wav_file, load_wav_from_bytes).
  • Mel-spectrogram front-end and audio-INPUT encoders (Gemma4 USM, Nemotron Parakeet/Conformer).
  • Server-side audio extraction: src/server/media.rs (extract_chat_audio_data).
  • Server architecture: Axum; routes registered in src/server/app.rs (create_app); handlers in src/server/routes/; types in src/server/types/; generation via src/server/model_provider.rs; error envelope ErrorResponse; admission via state.can_accept_request().

Missing (must be built):

  • An ASR (Whisper-style) model.
  • A TTS model plus vocoder/codec.
  • Audio OUTPUT encoding (WAV/mp3 write; only read exists today).
  • multipart/form-data upload parsing (axum::extract::Multipart).
  • Binary audio responses.
  • /v1/audio/* routes.

Goal

mlxcel-server exposes the OpenAI-compatible audio API surface end-to-end (/v1/audio/speech, /v1/audio/transcriptions, /v1/audio/translations), with at least one working STT checkpoint and one working TTS checkpoint, validated against real audio. Models run in-process (no external runtime dependency), which is why this epic spans new model ports plus server plumbing.

Sub-issues

Phase 1

Phase 2

Recommended delivery order: land STT (#365) before TTS (#366). Both hard-depend only on the Phase 1 plumbing (#364) and can otherwise proceed in parallel.

Acceptance Criteria

  • All three sub-issues completed, integrated, and merged.
  • The server exposes /v1/audio/speech, /v1/audio/transcriptions, and /v1/audio/translations end-to-end.
  • At least one working STT checkpoint transcribes real uploaded audio.
  • At least one working TTS checkpoint synthesizes playable audio.
  • End-to-end validation against real audio (not build-only or synthetic-only).

Technical Considerations

  • In-process models; register new model_types in src/models/detection.rs.
  • Reuse the existing log-mel front-end (src/audio/feature_extractor.rs) for ASR.
  • Phase 1 defines the audio-model interface (trait/enum) and the audio-output encoder so Phase 2 plugs in without reworking the server surface.

Sub-issues

Sub-issues

3 of 3 Issues completed
Loading 3 sub-issues

Metadata

Metadata

Assignees

Labels

area:inferencearea:modelspriority:mediumstatus:donetype:enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions