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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

gigastt-2.11.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.11.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: gigastt-2.11.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.11.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 14b67630375513b8d491b3f9bc570bf31d8a98f7ef6a8642eeaa89e99218a1b2
MD5 dc7f45ded802eb26c9effb372b9cd29b
BLAKE2b-256 7c40a6566242639ed15346e117bfff0354ef0deb1dad8bfb98e115815bb183d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.11.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2d7132e4572a3b80fdfde884e145c5b82b9109c0f8ec8f6ab0271d51dc769ec8
MD5 1afe53120051d97193f3e735bb47417b
BLAKE2b-256 56e2c8fc80ed6a608b0a053936d0e281f4d65f4446444dd230b578e8cd1daec0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.11.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d2f2c2dee6d11026a1bf6f34821877efbf7af945ea7262cce31082c87d95f678
MD5 db020de5318110242bc4907d0bb66e6a
BLAKE2b-256 d396782d69a2d8db346703a5c0a96a2cd5254614d1212d3f193b71018d06a456

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.11.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c741e89e35354115a3c8e9de17c2776983453a48ebc15a55d8b812e7e7a5f093
MD5 542842d2cfa6277f6617ffb97ea9e6e0
BLAKE2b-256 555c3e3ddfb94561d5dafd63d9f092f8cefb7eaa9ed203e9564c0450b1894417

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

This release

2.11.0 This release

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