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 (GigasttError → 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 GigasttError: 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.GigasttError.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.10.0-py3-none-win_amd64.whl (9.0 MB view details)

Uploaded Python 3Windows x86-64

gigastt-2.10.0-py3-none-manylinux_2_28_x86_64.whl (11.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

gigastt-2.10.0-py3-none-manylinux_2_28_aarch64.whl (11.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

gigastt-2.10.0-py3-none-macosx_11_0_arm64.whl (9.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for gigastt-2.10.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2732af70b3026e862c8139b0931b8b75c034fae013b4c6741ac1083145e7867a
MD5 3b70cdf77eac44ce80296313edcd6382
BLAKE2b-256 41c0dd3d3e71600fbe85a58ef556362c28f0689f4e8f51825af36af328f1ed00

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.10.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1726fcabdeb15375fe770d32e09a29f9469a06f2cad08fe26353c002c63c3dd7
MD5 0e3723aa1ca6ea8e05e67ba966803af5
BLAKE2b-256 d9e4834032525c9ab060fa2e0d3186d7b974ba4246fad6ef4479e845896f4f4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.10.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 60896fc3d9a2a5639381bbe8495316a6040d90c5f261c2d695c90a494390d483
MD5 c2d3a75c46c3f3f29d75dc9d3ec2798f
BLAKE2b-256 336c7ab048a95c7fa0ef9fd497c87b9020dea27a40b7565d886271b5fddbfe1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.10.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 912ffa1dabaa16441b11533832618cb84323b21beba5688453d2fd303063fefb
MD5 8073ed04b04b2b44daeb79dd6e1742fe
BLAKE2b-256 f3d6b26e3022303a8f790ac0781187c443148af645f77dba4f0a034bbfca906c

See more details on using hashes here.

Release history Release notifications | RSS feed

2.18.0

4 files

2.17.0

4 files

2.14.0

4 files

2.11.0

4 files

This release

2.10.0 This release

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