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.17.0-py3-none-win_amd64.whl (8.8 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

gigastt-2.17.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.17.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: gigastt-2.17.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.17.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f448acc9e920b96caadbbbccca00c8d2680e72ca1cd4d0153aaeffd2902131dd
MD5 e54973b39a1ac07a6f04ef5d3eed8774
BLAKE2b-256 fc95663c11b67709d1ca3915fe7449d6ef0a2b09332c715f41e3ea12f7c04a04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.17.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 437709ee8d51ba43d771f089a40c612900061edb48c22701937e7afaedb967ad
MD5 ef99c4f7b5369b0c8bb1fff98dcbb48e
BLAKE2b-256 2d4ececf3c7bb7ac6f05335123f2798adc7d6b9b3104a09990aa21a1d838fea7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.17.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ccfc00164e81ff9c5fb5b6603de8e3537289e2546f22dd18a1d0e7b153bc60ed
MD5 1d8ea2ec09f692ba2eef4eb985805e86
BLAKE2b-256 09ccf067b4c7993b697c2bc98ea812eece68cdb569b94078187cc890617fd378

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.17.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 60b7d005359cbd27adb12bded419bc385853688c16d02bbf220c1b1b56be3ba8
MD5 bd099517bb80488ddb42997c1c090229
BLAKE2b-256 7069d4b2f709f17616a32347550112387331f5521bf040c53245d3eb22d836ca

See more details on using hashes here.

Release history Release notifications | RSS feed

2.18.0

4 files

This release

2.17.0 This release

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