Skip to content

[BUG] livekit-plugins-speechmatics unconditionally requires speechmatics-voice[smart] #99

@JosefJamesHaard

Description

@JosefJamesHaard

Which SDK are you using?

  • speechmatics-rt (Real-Time SDK)
  • speechmatics-batch (Batch SDK)
  • speechmatics-voice (Voice SDK)
  • All

Package Information

  • Package Name: speechmatics-voice
  • Package Version: 0.2.8

Describe the bug
As mentioned in the title, livekit-plugins-speechmatics declares speechmatics-voice[smart] as a dependency, which means it unconditionally pulls in transformers, safetensors and onnxruntime for all users. it looks to be that the [smart] extra exists specifically because these ML dependencies are intended to be optional, as they are only used in _smart_turn.py. Hardcoding the extra defeats that purpose.

To Reproduce

  1. Install livekit-plugins-speechmatics
  2. look at resolved dependencies
  3. Observe that transformers, safetensors and onnxruntime get installed depsite not being needed for standard STT usage (turn detection modes which are not smart mode)

Expected behavior
Installing the plugin (livekit-plugins-speechmatics) should only require speechmatics-voice (no extra). Those who need ML based detection should opt in via livekit-plugins-speechmatics[smart] instead, which would pull in speechmatics-voice[smart]

Actual behavior
Since they are installed unconditionally in our case this causes package bloat and forces us to work around it with a uv dependency metadata override, which is fragile, and will break on every version bump:

[[tool.uv.dependency-metadata]]
name = "livekit-plugins-speechmatics"
version = "1.4.2"
requires-dist = ["livekit-agents>=1.4.2", "speechmatics-voice>=0.2.8"]

It would be great not to have to maintain this override manually in the future

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions