Skip to main content

Crate raqeem_core

Crate raqeem_core 

Source
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. text is the model’s verbatim output; the folded text_normalized (see normalize_ar) is what downstream parsers consume.

Enums§

Error
Everything that can go wrong on the way from an audio file to a transcript.
OutputFormat
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.

Type Aliases§

Result