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

Uploaded Python 3Windows x86-64

gigastt-2.14.0-py3-none-manylinux_2_28_x86_64.whl (11.2 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

gigastt-2.14.0-py3-none-manylinux_2_28_aarch64.whl (12.1 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

gigastt-2.14.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.14.0-py3-none-win_amd64.whl.

File metadata

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

File hashes

Hashes for gigastt-2.14.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 caf87f17540d955873267a7df3143fb275487849897a63e885e8a470264ebe9c
MD5 524acc87b4de4e29c0dc999ea98b2095
BLAKE2b-256 5a510d76ea681191784f6ed26caa9100fce7e9ba4018e02984f908126d7a1ada

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.14.0-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 eef5ac4807a281976d732660ccb7624d0adc9b7d2d341d3432f887fe2ab8b0d4
MD5 0a3457630707b7aa3467c11f740d0616
BLAKE2b-256 c7430f8967cf963275ca037c3d8395d2464fede1487670763fd1fca6a076f013

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.14.0-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a73ac54829f4923db5fe753f4b6e9c4d5cf0347615a604b8009c5fdb0bef89b4
MD5 d6fddbdd1fc12b0e49a7d1f350ab02e1
BLAKE2b-256 01d8158a2c5e6c8465b231c021c72fe08f940bfb5ed2e49c139cbb6dc67cc5a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gigastt-2.14.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 079b939a42cfb7d6b10a870f3cacd4aa5dc26412971c6ab2d487f97c4e093e17
MD5 9f11be38a59a146119ae54c00f8969e7
BLAKE2b-256 d56a3bcb50f0ec054591a282467fd791b3d8bc526eb11d436a66eb9d4d80ac09

See more details on using hashes here.

Release history Release notifications | RSS feed

2.18.0

4 files

2.17.0

4 files

This release

2.14.0 This release

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