Skip to main content

gigastt-uniffi

Idiomatic Swift, Kotlin, and Python bindings for gigastt — on-device Russian speech-to-text — generated from one Rust source with UniFFI.

Wraps the synchronous gigastt-core engine: models are side-loaded (no HTTP download dependency) and inference uses the blocking pool path (no tokio runtime), so the bindings are lean. Errors are typed (GigasttFfiError → Swift throws / Kotlin exceptions / Python exceptions) and objects are reference-counted (no manual free).

API

Type Methods
Engine new(model_dir) · new_with_pool_size(model_dir, pool_size) · transcribe_file(path) -> Transcript
Stream new(engine) · process_chunk(pcm16, sample_rate) -> [TranscriptSegment] · flush() -> [TranscriptSegment]
records Transcript { text, words, duration_s } · TranscriptSegment { text, words, is_final } · Word { text, start_s, end_s, confidence, speaker }
errors GigasttFfiError: ModelNotFound · InvalidAudio · PoolExhausted · Inference · InvalidArgument

process_chunk takes little-endian mono PCM16 and resamples to 16 kHz internally.

Generating the bindings

Build the cdylib, then run the version-pinned generator against it:

cargo build -p gigastt-uniffi
LIB=target/debug/libgigastt_uniffi.dylib   # .so on Linux

cargo run -p gigastt-uniffi --bin uniffi-bindgen -- generate --library "$LIB" --language python --out-dir bindings/python
cargo run -p gigastt-uniffi --bin uniffi-bindgen -- generate --library "$LIB" --language swift  --out-dir bindings/swift
cargo run -p gigastt-uniffi --bin uniffi-bindgen -- generate --library "$LIB" --language kotlin --out-dir bindings/kotlin

Generated bindings are build artifacts (bindings/ is git-ignored). Packaging them into a SwiftPM .xcframework, an Android .aar, and a PyPI wheel is the next step (prebuilt-artifacts task).

Python (quickstart, verified)

Install the prebuilt wheel — pip install gigastt — no compiler, no protoc, no onnxruntime download (it is statically linked; the wheel is py3-none-<platform>, one per platform across all Python 3.x). The ~215 MB model is side-loaded at runtime. Wheels are built + published by .github/workflows/python-wheels.yml.

# pip install gigastt
import gigastt_uniffi as g

engine = g.Engine("/path/to/gigastt/models")        # side-loaded model dir
t = engine.transcribe_file("recording.wav")
print(t.text)                                       # -> "шестьдесят тысяч тенге сколько будет стоить"
for w in t.words:
    print(w.text, w.start_s, w.end_s, w.confidence)

# streaming
s = g.Stream(engine)
for seg in s.process_chunk(pcm16_bytes, 16000):
    print(seg.text)
print([seg.text for seg in s.flush()])

Errors surface as exceptions:

try:
    g.Engine("/no/such/dir")
except g.GigasttFfiError.ModelNotFound as e:
    ...

Features

coreml / cuda / nnapi forward to gigastt-core for hardware acceleration. The core dependency is lean (file-decode only — no net, no async-pool).

License

MIT.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

gigastt-2.18.0-py3-none-win_amd64.whl (8.8 MB view details)

Uploaded Python 3Windows x86-64

gigastt-2.18.0-py3-none-manylinux_2_28_x86_64.whl (11.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

gigastt-2.18.0-py3-none-manylinux_2_28_aarch64.whl (12.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

gigastt-2.18.0-py3-none-macosx_11_0_arm64.whl (9.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file gigastt-2.18.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: gigastt-2.18.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 8.8 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.14.1

File hashes

Hashes for gigastt-2.18.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0ab3f2b151a14378565f165c477a7bfcd2dace006654dc864c9ac54d67147a5a
MD5 b36c1e3794a4292622e5f0a2f1381c7a
BLAKE2b-256 7cb2c24178cbcf6c6f4d17659e4830ec8805add2891c4c79e53f32527db5f390

See more details on using hashes here.

File details

Details for the file gigastt-2.18.0-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gigastt-2.18.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cda9a3db72578942cdaeaf3792fc03387f339df5886e31923cb87968bf5ff288
MD5 484476f5125455d303d09ff9e73d647e
BLAKE2b-256 8d1a8d041804d401291becad21e4401e48d3c18e792416c643d86f1c1c8dcc89

See more details on using hashes here.

File details

Details for the file gigastt-2.18.0-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for gigastt-2.18.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 66662005b5cd9bc4d6ea47ce79b097d1706fcc8a4f4b249720c7450f2258c676
MD5 60843a1a0fc0e551de55f2e3cd214f39
BLAKE2b-256 680611f5fb2c00222ce5b3e04a691f4a6503d5cd33219b35c074a9b91be7d515

See more details on using hashes here.

File details

Details for the file gigastt-2.18.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gigastt-2.18.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc55adfda7655caf3826403fb3381ca4938c4a82b3bd7eb0cf7251d7f4106753
MD5 b75e5bada137df4d47631872f53d3076
BLAKE2b-256 8bff0ec1a9ca0c734b3beb5db161f75f6071d43c4f77b85f8ac723cba4ba71ef

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.18.0 This release

4 files

2.17.0

4 files

2.14.0

4 files

2.11.0

4 files

2.10.0

4 files

2.3.0

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page