Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[alias]
xtask = "run --package xtask --"

[env]
# The transcribe.cpp static crate does not carry the optional system BLAS
# library through to Voxtype's final link on Linux. Its scalar decoder path
# needs no extra runtime dependency and matches upstream's distributable build.
TRANSCRIBE_CMAKE_ARGS = "-DTRANSCRIBE_USE_SYSTEM_BLAS=OFF"
44 changes: 33 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ ort = { version = "2.0.0-rc.12", optional = true, default-features = false, feat
ndarray = { version = "0.16", optional = true }
half = { version = "2", optional = true }
tokenizers = { version = "0.20", optional = true, default-features = false, features = ["onig"] }
transcribe-cpp = { version = "=0.2.3", optional = true, default-features = false }
rustfft = { version = "6", optional = true }

# OpenVINO GenAI backend (Intel NPU/CPU/GPU via OpenVINO GenAI WhisperPipeline)
Expand Down Expand Up @@ -188,7 +189,7 @@ osd-native = [
"dep:bytemuck",
]
osd-gtk4 = ["dep:gtk4", "dep:gtk4-layer-shell", "dep:cairo-rs", "dep:glib"]
gpu-vulkan = ["whisper-rs/vulkan"]
gpu-vulkan = ["whisper-rs/vulkan", "cohere-gguf", "transcribe-cpp/vulkan"]
gpu-cuda = ["whisper-rs/cuda"]
gpu-metal = ["whisper-rs/metal"]
gpu-hipblas = ["whisper-rs/hipblas"]
Expand Down Expand Up @@ -247,7 +248,9 @@ omnilingual-tensorrt = ["omnilingual", "onnx-tensorrt-enabled"]
# 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 = ["onnx-common", "dep:half", "dep:tokenizers", "cohere-gguf"]
# GGUF models run in-process through transcribe.cpp's Rust binding.
cohere-gguf = ["dep:transcribe-cpp"]
cohere-cuda = ["cohere", "onnx-cuda-enabled"]
cohere-tensorrt = ["cohere", "onnx-tensorrt-enabled"]
# Soniox is unconditional. Its deps (tokio-tungstenite, futures-util, reqwest)
Expand Down
50 changes: 46 additions & 4 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1486,10 +1486,10 @@ Cohere Transcribe is an encoder-decoder ASR model from Cohere Labs. It currently
### model

**Type:** String
**Default:** `"cohere-transcribe-int8"`
**Default:** `"cohere-transcribe-q4f16"`
**Required:** No

The Cohere model to use. Can be a model name (looked up in `~/.local/share/voxtype/models/<name>/`) or an absolute path to a model directory.
The Cohere model to use. ONNX models use a model name (looked up in `~/.local/share/voxtype/models/<name>/`) or a directory path. GGUF models use a `.gguf` file path, including `cohere-transcribe-03-2026-Q4_K_M.gguf`.

**Available models:**

Expand All @@ -1498,9 +1498,11 @@ The Cohere model to use. Can be a model name (looked up in `~/.local/share/voxty
| `cohere-transcribe-q4f16` | int4 weights, FP16 KV | ~1.5 GB | Recommended; smallest download, fastest CPU |
| `cohere-transcribe-q4` | int4 weights, FP32 KV | ~2.0 GB | Same accuracy as q4f16, larger memory |
| `cohere-transcribe-int8` | int8 | ~2.9 GB | Quality reference for quantized models |
| `cohere-transcribe-fp16` | FP16 | ~3.9 GB | Highest accuracy, largest download |
| `cohere-transcribe-fp16` | FP16 | ~3.9 GB | Highest accuracy, largest ONNX download |
| `cohere-transcribe-03-2026-Q4_K_M.gguf` | Q4_K_M GGUF | 1.56 GB | transcribe.cpp, tested on Intel Vulkan |
| `cohere-transcribe-03-2026-Q8_0.gguf` | Q8_0 GGUF | 2.41 GB | transcribe.cpp reference quantization |

All variants are HuggingFace Optimum exports of Cohere Transcribe (16384 vocab, 14 languages). Download via `voxtype setup model` (interactive) — pick the Cohere section and confirm the size warning.
The first four variants are HuggingFace Optimum ONNX exports. The GGUF variants are published for transcribe.cpp by handy-computer. Download either format via `voxtype setup model` (interactive), or pass its exact name to `voxtype setup --download --model <name>`. Setup verifies GGUF downloads against the publisher's SHA-256 before installing them.

**Performance (warm CPU, voxtype 0.7.0, dictation-length audio):**

Expand Down Expand Up @@ -1546,6 +1548,20 @@ language = "fr"

The daemon resolves the language to its decoder prefix at startup. Unsupported codes are rejected with a clear error.

### max_chunk_secs and boundary_search_secs

**Defaults:** `35` seconds and `2.5` seconds, respectively.

Cohere recordings longer than `max_chunk_secs` are divided into balanced segments before inference. Voxtype searches up to `boundary_search_secs` on either side of each target split for the quietest 100 ms of audio. Every sample is included once; adjacent segments do not overlap. This applies to both ONNX and GGUF Cohere models, including meeting audio passed to the engine. The model's official processor also chunks long recordings; keeping each inference at 35 seconds or less helps avoid long-form quality loss. Quiet-boundary splitting can still cut through speech when no silence is present.

`max_chunk_secs` accepts 5–35; `boundary_search_secs` accepts 0–5. Set the search to `0` for exact balanced splits. Shorter chunks can improve long-form accuracy but increase processing time, especially with GGUF's current per-chunk CLI startup.

```toml
[cohere]
max_chunk_secs = 30
boundary_search_secs = 2.5
```

### threads

**Type:** Integer (optional)
Expand Down Expand Up @@ -1581,6 +1597,9 @@ on_demand_loading = true
| `model` | `--model` | `VOXTYPE_MODEL` | `"cohere-transcribe-q4f16"` | Cohere model name or path |
| `language` | `--language` | `VOXTYPE_LANGUAGE` | `"en"` | One of the 14 supported language codes |
| `threads` | - | - | auto | ONNX intra-op thread count |
| `gguf_backend` | - | - | `"auto"` | transcribe.cpp backend for GGUF models |
| `max_chunk_secs` | - | - | `35` | Maximum seconds per Cohere inference |
| `boundary_search_secs` | - | - | `2.5` | Quiet-boundary search radius in seconds |
| `on_demand_loading` | - | - | `false` | Load model only when recording starts |

### Complete Example
Expand All @@ -1606,6 +1625,29 @@ cargo build --release --features cohere-tensorrt # NVIDIA + TensorRT EP

The prebuilt `voxtype-*-onnx-*` release binaries already include `cohere`, so users installing via AUR/.deb/.rpm don't need to rebuild.

### GGUF with Vulkan

GGUF models use [transcribe.cpp](https://github.com/handy-computer/transcribe.cpp) in the Voxtype daemon through its Rust binding. The model and session remain loaded across recordings when `on_demand_loading = false`. This is the same `cohere` engine in Voxtype, with a different inference runtime selected by the `.gguf` extension. The ONNX model directory and GGUF file are distinct formats.

Build Voxtype with `--features gpu-vulkan`, then run `voxtype setup model` and choose a Cohere GGUF variant. To download without activating it:

```sh
voxtype setup --download --model cohere-transcribe-03-2026-Q4_K_M.gguf
```

To activate it explicitly, set:

```toml
engine = "cohere"

[cohere]
model = "cohere-transcribe-03-2026-Q4_K_M.gguf"
gguf_backend = "vulkan"
language = "en"
```

`gguf_backend = "vulkan"` requires a hardware Vulkan device and reports an error if none is selected; `"auto"` lets transcribe.cpp select the backend. `--features cohere-gguf` alone builds the CPU runtime; `--features cohere` also includes GGUF support. The Rust dependency builds transcribe.cpp from source and needs CMake and a C++ compiler; Vulkan builds also need Vulkan and SPIR-V headers plus `glslc`. Setup downloads Q4_K_M and Q8_0 from a pinned revision of the [official transcribe.cpp Cohere GGUF repository](https://huggingface.co/handy-computer/cohere-transcribe-03-2026-gguf); the other published quantizations remain usable by absolute path.

---

## [soniox]
Expand Down
5 changes: 2 additions & 3 deletions src/cli/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ pub enum Commands {
/// Specify which model to download (use with --download).
/// Whisper: tiny, base, small, medium, large-v3, large-v3-turbo (and .en variants).
/// Parakeet: parakeet-tdt-0.6b-v3, parakeet-tdt-0.6b-v3-int8.
/// Other engines (Moonshine, SenseVoice, Paraformer, Dolphin,
/// Omnilingual, Cohere, OpenVINO) take the directory-form names shown
/// by `voxtype info models`, e.g. cohere-transcribe-q4f16.
/// Other engines take the names shown by `voxtype info models`:
/// directory names for ONNX models, or a .gguf filename for Cohere.
#[arg(long, value_name = "NAME")]
model: Option<String>,

Expand Down
11 changes: 6 additions & 5 deletions src/cli/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ pub enum InfoAction {
/// List downloadable models per engine and which are installed
///
/// Every listing runs a cheap integrity check: file sizes against the
/// manifest recorded at download time, and the ggml header for whisper
/// models. A model that fails is reported as not installed.
/// manifest recorded at download time, the ggml header for Whisper, and
/// the size and GGUF header for Cohere GGUF. A model that fails is
/// reported as not installed.
Models {
/// Emit machine-readable JSON instead of human-readable text
#[arg(long)]
Expand All @@ -35,9 +36,9 @@ pub enum InfoAction {
#[arg(long, value_name = "NAME")]
engine: Option<String>,

/// Also hash every file of every installed model against the manifest
/// recorded at download time. Thorough and slow: it reads every byte
/// of every model, which is minutes for a full models directory.
/// Also hash installed models against available publisher checksums
/// or recorded manifests. Thorough and slow: it reads every byte of
/// every model, which is minutes for a full models directory.
#[arg(long)]
verify: bool,
},
Expand Down
32 changes: 29 additions & 3 deletions src/config/engines/cohere.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ use serde::{Deserialize, Serialize};

use super::super::default_on_demand_loading;

/// Cohere Transcribe speech-to-text configuration (ONNX-based, encoder-decoder).
/// Requires: cargo build --features cohere
/// Cohere Transcribe speech-to-text configuration (ONNX or GGUF).
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct CohereConfig {
/// Model name or directory containing the Cohere ONNX files.
/// Model name, ONNX directory, or path to a transcribe.cpp GGUF file.
/// Expects HuggingFace Optimum layout:
/// encoder_model.onnx (+ .onnx_data),
/// decoder_model_merged.onnx (+ .onnx_data),
Expand All @@ -18,6 +17,18 @@ pub struct CohereConfig {
/// "cohere-transcribe-fp16"
pub model: String,

/// transcribe.cpp compute backend for GGUF models (auto, cpu, vulkan, etc.).
#[serde(default = "default_gguf_backend")]
pub gguf_backend: String,

/// Maximum audio duration passed to Cohere in one inference, in seconds.
#[serde(default = "default_max_chunk_secs")]
pub max_chunk_secs: u32,

/// Search radius around a balanced split for the quietest boundary.
#[serde(default = "default_boundary_search_secs")]
pub boundary_search_secs: f32,

/// Language for transcription. Two-letter ISO 639-1 codes
/// (e.g. "en", "fr", "de"). Cohere supports 14 languages.
#[serde(default = "default_cohere_language")]
Expand All @@ -36,10 +47,25 @@ fn default_cohere_language() -> String {
"en".to_string()
}

fn default_gguf_backend() -> String {
"auto".to_string()
}

fn default_max_chunk_secs() -> u32 {
35
}

fn default_boundary_search_secs() -> f32 {
2.5
}

impl Default for CohereConfig {
fn default() -> Self {
Self {
model: "cohere-transcribe-q4f16".to_string(),
gguf_backend: default_gguf_backend(),
max_chunk_secs: default_max_chunk_secs(),
boundary_search_secs: default_boundary_search_secs(),
language: default_cohere_language(),
threads: None,
on_demand_loading: false,
Expand Down
5 changes: 2 additions & 3 deletions src/config/engines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ pub enum TranscriptionEngine {
/// Use Omnilingual (FunASR 50+ language CTC encoder via ONNX Runtime)
/// Requires: cargo build --features omnilingual
Omnilingual,
/// Use Cohere Transcribe (encoder-decoder via ONNX Runtime, Whisper-style
/// task tokens). Top of the Open ASR Leaderboard.
/// Requires: cargo build --features cohere
/// Use Cohere Transcribe through ONNX Runtime or transcribe.cpp GGUF.
/// Requires `cohere` for ONNX or `cohere-gguf` for GGUF.
Cohere,
/// Use OpenVINO Whisper (Intel NPU/CPU/GPU via OpenVINO Runtime).
/// Requires: cargo build --features openvino-whisper
Expand Down
Loading
Loading