Skip to content

[Enhancement] Add Flux model support for streaming transcription #158

Description

@deepgram-robot

Summary

Add support for Deepgram's Flux streaming model in the Rust SDK, including Flux-specific parameters (language detection per utterance, keyterms), and correct handling of Flux response format differences.

Problem it solves

Flux is Deepgram's latest streaming STT model offering lower latency and multilingual capabilities with per-turn language detection. Rust developers building low-latency, performance-critical voice applications — embedded systems, game engines, real-time communication servers — are a natural audience for Flux's speed advantages. Currently, the Rust SDK may not correctly handle Flux-specific parameters and response formats, preventing Rust developers from using Deepgram's fastest streaming model.

Proposed API

use deepgram::{Deepgram, listen::StreamOptions};

let dg = Deepgram::new(api_key)?;

let options = StreamOptions::builder()
    .model("flux")           // Flux model selection
    .language("multi")        // Multilingual mode
    .keyterms(vec!["Deepgram", "Nova"])  // Vocabulary boosting
    .smart_format(true)
    .interim_results(true)
    .build();

let mut stream = dg.listen().stream(options).await?;

while let Some(event) = stream.next().await {
    match event? {
        StreamEvent::Transcript(t) => {
            // Access detected language per utterance
            if let Some(lang) = t.detected_language() {
                println!("[{}] {}", lang, t.transcript());
            }
        }
        StreamEvent::SpeechStarted(_) => { /* ... */ }
        StreamEvent::UtteranceEnd(_) => { /* ... */ }
        _ => {}
    }
}

Acceptance criteria

  • Flux model can be selected via model("flux") in stream options
  • Multilingual mode supported via language("multi")
  • Keyterms/keyword boosting parameter correctly serialized
  • Response parsing handles Flux-specific fields (detected language per utterance)
  • Interim results work correctly with Flux's lower-latency delivery
  • Documented with usage example
  • Compatible with existing API

Raised by the DX intelligence system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions