Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
385 lines (338 loc) · 16 KB
/
Copy pathCargo.toml
File metadata and controls
385 lines (338 loc) · 16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
[workspace]
members = ["xtask", "crates/gguf-worker"]
[package]
name = "voxtype"
version = "1.2.2"
edition = "2021"
authors = ["Peter Jackson", "Jean-Paul van Tillo", "Máté Rémiás", "Rob Zolkos", "Dan Heuckeroth", "Igor Warzocha", "Julian Kaiser", "Kevin Miller", "konnsim", "reisset", "Zubair", "Loki Coyote", "Umesh", "Barrett Ruth", "André Silva", "Chmouel Boudjnah", "Christopher Albert", "Phuoc Thinh Vu", "Alexander Bosu-Kellett", "ayoahha", "Toizi", "kakapt", "Rinor Maloku", "Sami Jawhar", "jan Lemata", "Kai Stark", "graysky"]
description = "Push-to-talk voice-to-text for Wayland"
license = "MIT"
readme = "README.md"
keywords = ["voice", "speech", "whisper", "wayland", "linux"]
categories = ["multimedia::audio", "accessibility"]
[dependencies]
# Async runtime
tokio = { version = "1", features = ["full", "signal", "sync", "time", "process", "io-util"] }
# CLI
clap = { version = "4", features = ["derive", "env"] }
# Configuration
serde = { version = "1", features = ["derive"] }
toml = "0.8"
directories = "5"
dirs = "5"
cachedir = "0.3"
# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# Error handling
thiserror = "1"
anyhow = "1"
# Compile-time enum -> &'static str (replaces hand-written match blocks for
# TranscriptionEngine::name and similar lookup-by-variant patterns; new enum
# variants pick up the lowercase name automatically via serialize_all).
strum = { version = "0.26", default-features = false, features = ["derive"] }
# Text processing
regex = "1"
rphonetic = "4.0"
strsim = "0.11"
# Async traits
async-trait = "0.1"
# Common dependencies
libc = "0.2"
# Audio capture
cpal = "0.15"
hound = "3" # WAV file reading/writing
# HTTP client for remote transcription
ureq = { version = "2", features = ["json"] }
# WebSocket client for Soniox streaming backend
tokio-tungstenite = { version = "0.24", features = ["rustls-tls-webpki-roots"] }
futures-util = "0.3"
# Async HTTP client for Soniox async transcription API (multipart upload + poll)
reqwest = { version = "0.12", default-features = false, features = ["json", "multipart", "rustls-tls"] }
# JSON parsing (for CLI backend)
serde_json = "1"
# Version comparison for update checking
semver = "1"
# CLI path resolution (for CLI backend)
which = "7"
# Temp files (for CLI backend audio)
tempfile = "3"
# SHA-256 integrity check for R2 model downloads
sha2 = "0.10"
# Audio playback (for feedback sounds)
rodio = { version = "0.19", default-features = false, features = ["wav"] }
# Whisper speech-to-text
whisper-rs = "0.16.0"
# Parakeet speech-to-text (optional, ONNX-based)
# parakeet-rs's default features turn on ort's defaults, which fetch ONNX
# Runtime at build time over native-tls (OpenSSL). openssl-sys does not build
# against OpenSSL 4, which Arch now ships, so take parakeet-rs without its
# defaults and ask ort for the same features with rustls instead.
parakeet-rs = { version = "0.3.5", optional = true, default-features = false, features = ["cpu"] }
# ONNX-based ASR engines (Moonshine, SenseVoice, Paraformer, Dolphin, Omnilingual)
ort = { version = "2.0.0-rc.12", optional = true, default-features = false, features = ["std", "ndarray", "api-24", "half", "tracing", "download-binaries", "tls-rustls", "copy-dylibs"] }
ndarray = { version = "0.16", optional = true }
half = { version = "2", optional = true }
tokenizers = { version = "0.20", optional = true, default-features = false, features = ["onig"] }
# Inverse text normalization: spoken-form numbers/dates/currency to written
# form ("twenty five dollars" -> "$25"). Pure Rust port of NeMo text
# processing; grammars are compiled in, so no runtime data files.
text-processing-rs = { version = "0.2", optional = true }
rustfft = { version = "6", optional = true }
# OpenVINO GenAI backend (Intel NPU/CPU/GPU via OpenVINO GenAI WhisperPipeline)
# `runtime-linking` loads libopenvino_genai.so at runtime via openvino-finder.
# See the [patch.crates-io] entry below: pinned to a fork branch that adds
# with_properties() to WhisperPipeline (needed for CACHE_DIR compiled-model
# caching), pending upstream review.
openvino-genai = { version = "0.11.0", optional = true, features = ["runtime-linking"] }
# CPU count for thread detection
num_cpus = "1.16"
# File watching for status --follow
notify = "6"
# Single instance check
pidlock = "0.1"
# TUI for `voxtype configure`
ratatui = { version = "0.29", features = ["unstable-rendered-line-info"] }
crossterm = "0.28"
toml_edit = "0.22"
# Meeting mode (Pro feature)
uuid = { version = "1", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
rusqlite = { version = "0.32", features = ["bundled"] }
# OSD native frontend (SCTK + wgpu + egui-wgpu). All optional, gated by the
# `osd-native` feature so users not opting in don't pay the build cost.
smithay-client-toolkit = { version = "0.20", optional = true }
calloop = { version = "0.14", optional = true }
calloop-wayland-source = { version = "0.4", optional = true }
wayland-client = { version = "0.31", optional = true, features = ["system"] }
wayland-backend = { version = "0.3", optional = true, features = ["client_system"] }
wayland-protocols = { version = "0.32", optional = true, features = ["client", "staging"] }
wayland-protocols-wlr = { version = "0.3", optional = true, features = ["client"] }
wgpu = { version = "29", optional = true, default-features = false, features = ["vulkan", "gles", "wgsl", "std"] }
egui = { version = "0.34", optional = true }
egui-wgpu = { version = "0.34", optional = true, default-features = false }
raw-window-handle = { version = "0.6", optional = true }
pollster = { version = "0.4", optional = true }
bytemuck = { version = "1", optional = true }
# OSD GTK4 frontend (gated on `osd-gtk4` feature; dyn-links system GTK4).
gtk4 = { version = "0.11", optional = true }
gtk4-layer-shell = { version = "0.8", optional = true }
cairo-rs = { version = "0.22", optional = true }
glib = { version = "0.22", optional = true }
rubato = "0.16"
[target.'cfg(target_os = "macos")'.dependencies]
tao = "0.32"
core-graphics = "0.24"
core-foundation = "0.10"
dirs = "5"
mac-notification-sys = "0.6" # Native macOS notifications
# Global hotkey + menubar icon. Both are macOS-only:
# rdev is consumed by src/hotkey_macos.rs
# tray-icon is consumed by src/menubar.rs
# Declaring them at the top level pulled in libappindicator → GTK3 system
# dev deps (glib-sys, gdk-pixbuf-sys, atk-sys, …) on every Linux build,
# breaking NixOS source builds that didn't list those in the derivation
# (Issue #352). Linux daemon doesn't use either, so they live here.
rdev = "0.5.3"
tray-icon = "0.21.3"
[target.'cfg(target_os = "linux")'.dependencies]
png = "0.17"
ksni = { version = "0.3.7", default-features = false, features = ["tokio"] }
# Input handling (evdev for kernel-level key events)
evdev = "0.13.2"
inotify = "0.10" # Watch /dev/input for device hotplug
nix = { version = "0.29", features = ["signal", "process"] } # Unix signals for IPC
# MPRIS media-player control over the session bus. Talking D-Bus directly
# instead of shelling out to playerctl lets us see MPRIS-compliant players
# that playerctl silently filters out, and surfaces real errors on resume.
zbus = { version = "4", default-features = false, features = ["tokio"] }
[features]
default = ["itn"]
# OSD frontends. Each binary is gated on its own feature so users can
# build only the rendering stack they need. Real GUI deps land in
# Commits 4a/4b; the lists below grow then.
osd-native = [
"dep:smithay-client-toolkit",
"dep:calloop",
"dep:calloop-wayland-source",
"dep:wayland-client",
"dep:wayland-backend",
"dep:wayland-protocols",
"dep:wayland-protocols-wlr",
"dep:wgpu",
"dep:egui",
"dep:egui-wgpu",
"dep:raw-window-handle",
"dep:pollster",
"dep:bytemuck",
]
osd-gtk4 = ["dep:gtk4", "dep:gtk4-layer-shell", "dep:cairo-rs", "dep:glib"]
gpu-vulkan = [
"whisper-rs/vulkan",
"cohere-gguf",
"parakeet-gguf",
"gguf",
]
gpu-cuda = ["whisper-rs/cuda"]
gpu-metal = ["whisper-rs/metal"]
gpu-hipblas = ["whisper-rs/hipblas"]
# ML-based speaker diarization (uses ONNX for embedding extraction)
ml-diarization = ["dep:ort", "dep:ndarray"]
# Parakeet backend (ONNX-based, alternative to Whisper)
parakeet = ["dep:parakeet-rs", "dep:ort"]
parakeet-cuda = ["parakeet", "parakeet-rs/cuda"]
parakeet-tensorrt = ["parakeet", "parakeet-rs/tensorrt"]
parakeet-migraphx = ["parakeet", "parakeet-rs/migraphx"]
parakeet-coreml = ["parakeet", "parakeet-rs/coreml"]
# Parakeet GGUF models run through transcribe.cpp in voxtype-gguf-worker, like
# Cohere's. Not implied by `parakeet`: transcribe.cpp is only faster than ONNX
# Runtime on a GPU. `gpu-vulkan` enables it, and every release Dockerfile
# passes gguf,cohere-gguf,parakeet-gguf explicitly (see
# scripts/verify-gguf-companion.sh).
#
# Both GGUF features only enable the client that drives the worker. voxtype
# itself must never depend on transcribe-cpp: its ggml collides with
# whisper-rs's. See crates/gguf-worker/Cargo.toml.
parakeet-gguf = []
gguf = []
# Dynamic loading for system ONNX Runtime (used by Nix builds)
parakeet-load-dynamic = ["parakeet", "parakeet-rs/load-dynamic"]
# Inverse text normalization for dictated numbers, dates, currency and URLs.
# On by default: pure Rust, no native deps, so every release build ships it
# and `[text] format_numbers` works without a custom build.
itn = ["dep:text-processing-rs"]
# Shared ONNX dependencies for engines using fbank/CTC preprocessing
onnx-common = ["dep:ort", "dep:ndarray", "dep:rustfft"]
# Multilingual punctuation restoration and true-casing for plain CTC output.
# Kept separate from onnx-common because Whisper-only release binaries do not
# ship ONNX Runtime and engines that already punctuate must not pay the model
# or tokenizer cost.
punctuation-casing = ["onnx-common", "dep:tokenizers"]
# Marker features that aggregate per-engine GPU EP flags. Each engine's
# session builder calls a shared helper (src/transcribe/onnx_ep.rs) that
# checks these markers to decide which EPs to register at runtime.
# Enabling any *-cuda feature pulls onnx-cuda-enabled in transitively;
# same for *-migraphx and *-tensorrt.
onnx-cuda-enabled = ["ort/cuda"]
onnx-migraphx-enabled = ["ort/migraphx"]
onnx-tensorrt-enabled = ["ort/tensorrt"]
# Moonshine backend (ONNX-based, encoder-decoder ASR).
# No migraphx feature — MIGraphX 7.2 can't compile Moonshine's
# encoder-decoder `If` op (different output shapes between branches).
# AMD users run Moonshine on CPU.
moonshine = ["onnx-common", "dep:tokenizers"]
moonshine-cuda = ["moonshine", "onnx-cuda-enabled"]
moonshine-tensorrt = ["moonshine", "onnx-tensorrt-enabled"]
# SenseVoice backend (ONNX-based, CTC encoder-only ASR).
# No migraphx feature — MIGraphX rejects the encoder's Where-op
# broadcast pattern (axis mismatch). AMD users run SenseVoice on CPU.
sensevoice = ["onnx-common", "punctuation-casing"]
sensevoice-cuda = ["sensevoice", "onnx-cuda-enabled"]
sensevoice-tensorrt = ["sensevoice", "onnx-tensorrt-enabled"]
# Paraformer backend (FunASR ONNX-based CTC encoder).
# No migraphx feature — MIGraphX EP segfaults during model load.
# AMD users run Paraformer on CPU.
paraformer = ["onnx-common", "punctuation-casing"]
paraformer-cuda = ["paraformer", "onnx-cuda-enabled"]
paraformer-tensorrt = ["paraformer", "onnx-tensorrt-enabled"]
# Dolphin backend (ONNX-based CTC encoder, dictation-optimized).
# No migraphx feature — MIGraphX rejects the encoder's Slice op shape.
# AMD users run Dolphin on CPU.
dolphin = ["onnx-common", "punctuation-casing"]
dolphin-cuda = ["dolphin", "onnx-cuda-enabled"]
dolphin-tensorrt = ["dolphin", "onnx-tensorrt-enabled"]
# Omnilingual backend (FunASR ONNX-based, 50+ languages).
# No migraphx feature — graph compiles but produces garbled output and
# pays a 65s+ compile penalty per first inference. AMD users run on CPU.
omnilingual = ["onnx-common", "punctuation-casing"]
omnilingual-cuda = ["omnilingual", "onnx-cuda-enabled"]
omnilingual-tensorrt = ["omnilingual", "onnx-tensorrt-enabled"]
# Cohere Transcribe backend (ONNX-based encoder-decoder, Whisper-style task tokens).
# Top of the Open ASR Leaderboard. Wired into CLI/config/factory; users opt in
# via `cargo build --features cohere` and the model files are downloaded into
# the standard models directory like other ONNX engines.
cohere = ["onnx-common", "dep:half", "dep:tokenizers", "cohere-gguf"]
# GGUF models run in-process through transcribe.cpp's Rust binding.
cohere-gguf = []
cohere-cuda = ["cohere", "onnx-cuda-enabled"]
cohere-tensorrt = ["cohere", "onnx-tensorrt-enabled"]
# Soniox is unconditional. Its deps (tokio-tungstenite, futures-util, reqwest)
# add ~1-2 MB after LTO+strip and ride alongside ureq, which every binary
# already ships for model downloads. Treating it like remote.rs (also always
# compiled) keeps the engine surface uniform across release flavors.
# No cohere-migraphx feature: MIGraphX 7.2 still fails on the
# onnx-community q4 export. Original blocker was MatMulNBits bits=8
# (cstr int8); q4 has bits=4 which is supported, but its zero_points
# tensor layout (`[hidden, blocks_per_row]`) doesn't match MIGraphX's
# expected flat `[hidden * blocks_per_row]` layout. Re-enable when
# MIGraphX upstream accepts the standard onnx-community q4 layout, or
# when we ship a re-quantized model that matches MIGraphX's expectation.
# Dynamic loading for system ONNX Runtime. Used by Nix builds and the
# AMD/MIGraphX binary, which pairs with the system `onnxruntime-rocm`
# package (no upstream pyke prebuilt ships the MIGraphX provider .so).
onnx-load-dynamic = ["ort/load-dynamic"]
# OpenVINO Whisper backend (Intel NPU/CPU/GPU via OpenVINO GenAI WhisperPipeline)
openvino-whisper = ["dep:openvino-genai"]
[build-dependencies]
clap = { version = "4", features = ["derive"] }
clap_mangen = "0.2"
[dev-dependencies]
dirs = "5.0"
[profile.release]
lto = true
codegen-units = 1
strip = true
opt-level = 3
[profile.dev]
opt-level = 1 # Faster dev builds, whisper still usable
[[bin]]
name = "voxtype"
path = "src/main.rs"
[[bin]]
name = "voxtype-osd-native"
path = "src/bin/voxtype_osd_native/main.rs"
required-features = ["osd-native"]
[[bin]]
name = "voxtype-osd-gtk4"
path = "src/bin/voxtype_osd_gtk4.rs"
required-features = ["osd-gtk4"]
# Tiny launcher that picks between voxtype-osd-gtk4, voxtype-osd-native,
# and voxtype-osd-quickshell at runtime based on config/env/CLI. Always
# built, no GUI deps; falls back to whichever frontend binary it finds on
# PATH if the preferred one isn't installed.
[[bin]]
name = "voxtype-osd"
path = "src/bin/voxtype_osd.rs"
# Sidecar that exposes the daemon's audio frame socket as NDJSON on stdout
# for clients (e.g. Quickshell QML's Process element) that can't read Unix
# sockets directly. No GUI deps; always built.
[[bin]]
name = "voxtype-audio-bridge"
path = "src/bin/voxtype_audio_bridge.rs"
# Quickshell launcher: finds voxtype's shell.qml and execs `qs -p <path>`.
# Always built, no GUI deps. Runtime dependency on the system `quickshell`
# package; the launcher prints a clear remediation message if `qs` is
# missing.
[[bin]]
name = "voxtype-osd-quickshell"
path = "src/bin/voxtype_osd_quickshell.rs"
# Internal helper that dumps the ONNX model registry as JSON for the
# `scripts/mirror-models-to-r2.sh` script. Not shipped in releases; it's
# a build-tree-only utility for populating R2 from upstream HF.
[[bin]]
name = "voxtype-mirror-registry"
path = "src/bin/voxtype_mirror_registry.rs"
[[example]]
name = "inspect_cohere_onnx"
required-features = ["cohere"]
# TEMPORARY: openvino-genai 0.11.0's WhisperPipeline has no way to pass
# device properties (CACHE_DIR etc.), unlike LlmPipeline/VlmPipeline in
# the same crate which already expose with_properties(). Pinned to a
# voxtype-org mirror of the fork branch that adds the same method for
# Whisper (upstream review pending at
# https://github.com/intel/openvino-rs/pull/196); mirrored so source
# builds don't depend on an individual's fork staying available.
# Drop this patch (and bump the openvino-genai version requirement above
# if needed) once that PR merges and ships in a crates.io release.
[patch.crates-io]
openvino-genai = { git = "https://github.com/voxtype/openvino-rs", branch = "whisper-pipeline-with-properties" }