Ports the kon-llm model_manager resume pattern the rest of the way
into kon-transcription::model_manager:
- download() now validates an existing complete file against its
sha256 before skipping; a hash mismatch removes the file and
re-fetches, instead of serving a corrupt file to whisper.cpp.
- download_file() now distinguishes 206 Partial Content, 200 OK
(resume silently ignored by server), and other statuses, rather
than treating any non-206 as 'just use it as a fresh start'.
200-on-Range is handled by discarding the partial and starting
over cleanly.
- New tests: download_file_resumes_from_partial_and_verifies_sha
(TcpListener fixture, same shape as kon-llm's), and
download_file_fails_on_sha_mismatch_and_cleans_part_file.
- sha256_of_file helper + unit test for the existing-file guard.
Dev-deps: tempfile + tokio(net/io-util/macros). Total workspace
lib-test count: 116 → 123.
Co-authored-by: jars <jakejars@users.noreply.github.com>
37 lines
1.1 KiB
TOML
37 lines
1.1 KiB
TOML
[package]
|
|
name = "kon-transcription"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Speech-to-text engine wrappers, model management, and inference concurrency for Kon"
|
|
build = "build.rs"
|
|
|
|
[dependencies]
|
|
kon-core = { path = "../core" }
|
|
|
|
# Parakeet via ONNX. Whisper is handled directly via whisper-rs below.
|
|
transcribe-rs = { version = "0.3", default-features = false, features = ["onnx"] }
|
|
|
|
# Async runtime for spawn_blocking
|
|
tokio = { version = "1", features = ["rt", "sync"] }
|
|
|
|
# Model downloads
|
|
reqwest = { version = "0.12", features = ["stream"] }
|
|
futures-util = "0.3"
|
|
|
|
# Download integrity verification
|
|
sha2 = "0.10"
|
|
|
|
whisper-rs = { version = "0.16", default-features = false, features = ["vulkan"] }
|
|
|
|
# Direct whisper-rs backend (WhisperRsBackend): thread pool sizing + typed errors.
|
|
num_cpus = "1"
|
|
thiserror = "2"
|
|
|
|
# Structured logging at backend boundaries (observability for initial_prompt flow).
|
|
tracing = "0.1"
|
|
|
|
[dev-dependencies]
|
|
# TcpListener fixture for the download resume tests (mirrors kon-llm).
|
|
tokio = { version = "1", features = ["rt", "sync", "net", "io-util", "macros"] }
|
|
tempfile = "3"
|