Skip to content

feat(server): wire Nemotron-H Nano Omni input_audio into the chat-completions audio dispatch #442

Closed

Description

@inureyes

Summary

The Nemotron-H Nano Omni audio path (the Parakeet/Conformer SoundEncoder) works from the CLI (mlxcel generate --audio) but is NOT reachable from the server. POST /v1/chat/completions with an input_audio content block only dispatches audio to the two Gemma 4 paths, so a loaded Nemotron-H Nano Omni model returns "model does not support audio" for audio chat requests.

Background

The server entry prepare_request_vlm_embeddings (src/server/model_worker.rs, around line 959) handles input_audio like this: when !audio.is_empty(), it tries prepare_gemma4_unified_audio_embeddings and then prepare_gemma4_audio_embeddings; if neither matches the loaded model, it falls through to the "model does not support audio (not Gemma4 or no audio tower)" branch. There is no prepare_nemotron_*_audio_embeddings server path. The CLI equivalent exists: compute_nemotron_h_nano_omni_audio_embeddings (src/commands/generate_vlm.rs), which loads the audio, runs NemotronHNanoOmniVlModel's extract_audio_features (now fallible after #435/#439), and expands the sound_context_token_id block via expand_nemotron_h_nano_omni_audio_tokens.

This is the same shape of gap that #437 (PR #440) just closed for Gemma 4 server audio: the model surface and the CLI embedding builder already exist; only the server input_audio dispatch and prompt placement are missing.

Scope

  • Add a server prepare_nemotron_h_nano_omni_audio_embeddings (mirroring the gemma4 server audio fns in src/server/model_worker.rs) that loads the input_audio bytes, resamples if the model's feature extractor expects a fixed rate (see how the CLI path handles the Nemotron feature extractor; note the Nemotron extractor differs from the Gemma 4 AudioFeatureExtractor and may hard-error on a rate mismatch rather than silently assuming 16 kHz, so confirm the right resample target), runs the encoder, and scatters the audio embeddings.
  • Insert the Nemotron sound-token block into the user turn of the server prompt, mirroring the fix: Gemma 4 server audio (input_audio) places <|audio|> outside the user turn (0-token output) #437/fix: place Gemma 4 server <|audio|> block inside the user turn #440 approach (the server flattens chat messages to text-only, so the sound_context_token_id marker must be placed into the user turn rather than appended; reuse or generalize the end-of-turn-anchored placement helper added in fix: place Gemma 4 server <|audio|> block inside the user turn #440 / expand_gemma4_audio_tokens_for_server, or the Nemotron CLI expander expand_nemotron_h_nano_omni_audio_tokens adapted for the server's text-only prompt).
  • Wire it into the !audio.is_empty() dispatch in prepare_request_vlm_embeddings alongside the two gemma4 calls.
  • Validate with a real-model server E2E: load a Nemotron-H Nano Omni checkpoint, POST /v1/chat/completions with an input_audio part, confirm a coherent (non-empty, non-0-token) response rather than "model does not support audio" or an immediate EOS. (Per fix: Gemma 4 server audio (input_audio) places <|audio|> outside the user turn (0-token output) #437's lesson, unit tests and code review are not sufficient for this class; the server must actually be run with the model.)

Acceptance Criteria

  • A Nemotron-H Nano Omni model loaded in mlxcel-server accepts an input_audio content block in POST /v1/chat/completions and produces a coherent response (audio is conditioned on, not ignored), validated end to end on a real checkpoint.
  • The audio block lands in the user turn (not the model turn), so the model does not EOS at prefill.
  • Gemma 4 server audio, image, and video requests, and all text-only requests, are unchanged (no prefix-cache or dispatch regression).

Related

Follow-up to #437 / PR #440 (the analogous Gemma 4 server input_audio fix; root cause there was a model-turn misplacement plus the Gemma 4 <turn|> end-of-turn-token rename). Nemotron-H Nano Omni audio fault isolation was hardened in #435 / PR #439. The CLI Nemotron audio path is in src/commands/generate_vlm.rs (compute_nemotron_h_nano_omni_audio_embeddings).

Activity

  1. added
    type:enhancement
    priority:medium
    area:inference
    area:core
    status:ready
    status:in-progress
    status:review
    and removed
    status:ready
    status:in-progress
    on Jun 25, 2026
  2. added
    status:done
    and removed
    status:review
    on Jun 25, 2026
  3. self-assigned this
    on Jun 25, 2026
  4. added a commit that references this issue on Jul 30, 2026
    5f72082
  5. added a commit that references this issue on Oct 27, 2026
    1eb2d00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:corearea:inferencepriority:mediumstatus:donetype:enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions