Expand description
raqeem-core — رقيم. Turn an audio file into Arabic text by delegating
inference to a transcription endpoint (Cohere’s hosted API, or your own
vLLM). This crate never loads model weights: it decodes nothing, runs no
model — it POSTs the audio and folds the result. That is what keeps it
light and callable from any language over the CLI.
use raqeem_core::{Endpoint, Transcriber};
let endpoint = Endpoint::cohere(std::env::var("COHERE_API_KEY").unwrap(), None);
let transcript = Transcriber::new(endpoint)
.language("ar")
.transcribe(std::path::Path::new("voice_note.ogg"))?;
println!("{}", transcript.text);Structs§
- Endpoint
- Where and how to reach a transcription server.
- Transcriber
- Transcribes audio by POSTing it to a configured
Endpoint. - Transcript
- A completed transcription.
textis the model’s verbatim output; the foldedtext_normalized(seenormalize_ar) is what downstream parsers consume.
Enums§
- Error
- Everything that can go wrong on the way from an audio file to a transcript.
- Output
Format - Provider
- A known transcription backend.
Constants§
- COHERE_
URL - Cohere’s hosted transcription endpoint.
- DEFAULT_
COHERE_ MODEL - Default model id for the Arabic transcriber. Cohere requires a dated model
id — undated aliases (
cohere-transcribe-arabic) return HTTP 404 “model not found”. Bump this when Cohere ships a newer dated Arabic transcription model. - DEFAULT_
LANGUAGE - Default transcription language (ISO-639-1). Arabic-first, by design.
- DEFAULT_
TIMEOUT_ SECS - Default total-request timeout, in seconds. Generous on purpose: it must cover upload + model inference + download, and CPU inference of a voice note can take many seconds. (reqwest’s blocking client otherwise silently defaults to 30s, which truncates a slow transcription mid-inference.)
Functions§
- normalize_
ar - Fold Arabic text to a matching-stable form. Idempotent; ASCII passes through lower-cased, so it is safe to run unconditionally on any transcript.