cogno-vox
Voice/audio I/O edge for the Cogno cognitive pipeline — speech-to-text in, text-to-speech out, behind provider-agnostic fallback chains.
cogno-vox is the mouth and ears of Cogno. Where cogno-anima is the mind (pure cognition) and cogno-engram is the memory (persistence substrate), cogno-vox is the transport edge that sits on the two boundaries of the pipeline:
gateway ──▶ [vox STT] ──▶ cogno-anima (NOUMENO…SUPEREGO) ──▶ [vox TTS] ──▶ gateway
audio→text text→audio
It is the most decoupled of the libraries: the core imports neither cogno-anima nor cogno-engram — it only converts audio ⇆ text.
Status: alpha — core (ports + OpenAI-compatible backends + fallback chains) and the unit suite are in place.
Two capability-scoped ports
Like cogno-anima's LLMBackend/Embedder and cogno-engram's three ports, each direction is a structurally-typed Protocol with its own fallback chain (try tier 1→N, first non-empty wins, all-fail → raises):
| Port | Async method | Reference backends |
|---|---|---|
TranscriberBackend (STT) |
transcribe(audio, filename) -> str |
OpenAI-compatible (faster-whisper-server / Groq / OpenAI), Gemini multimodal, Bedrock/Voxtral |
SynthesizerBackend (TTS) |
synthesize(text) -> bytes |
OpenAI-compatible (Kokoro / OpenAI), Grok, ElevenLabs, Gemini |
OpenAICompat* covers any /v1/audio/transcriptions or /v1/audio/speech server — local or cloud differ only by base_url/api_key, no SDK needed (just httpx).
Async by design
Everything is async (httpx.AsyncClient) to run under concurrent request load alongside cogno-anima/cogno-engram. Provider SDKs are lazy-imported behind extras (pip install "cogno-vox[bedrock]"); the OpenAI-compatible HTTP path needs no extra.
Host-injected config (no YAML, no env contextvar)
The host owns tier selection (model ladder, per-tenant routing, BYOK). You hand the factory a VoxConfig:
from cogno_vox import VoxConfig, TierConfig, create_transcriber, create_synthesizer
config = VoxConfig(
transcribe_tiers=(
TierConfig(provider="local", model="Systran/faster-whisper-small",
base_url="http://localhost:8000"),
TierConfig(provider="groq", model="whisper-large-v3-turbo",
base_url="https://api.groq.com/openai/v1", api_key="gsk_..."),
),
synthesize_tiers=(
TierConfig(provider="local", model="kokoro",
base_url="http://localhost:8880/v1", voice="af_alloy"),
TierConfig(provider="openai", model="tts-1", voice="alloy",
base_url="https://api.openai.com/v1", api_key="sk-..."),
),
default_tts_format="opus", # mandatory for Telegram native voice notes
)
stt = await create_transcriber(config).transcribe(audio_bytes, "voice.ogg")
print(stt.text, stt.tier, stt.elapsed_ms)
out = await create_synthesizer(config).synthesize("Olá, tudo bem?")
# out.audio (bytes), out.fmt, out.tier, out.elapsed_ms
split_text_for_tts() slices long replies into ~30s segments (≈65 words) at sentence boundaries — one voice note each.
What stays in the host
Provider/model selection, RBAC premium gating, BYOK & key rotation, the channel delivery (sendVoice/sendMedia) and the channel-mandated format choice. cogno-vox offers opus/mp3; the host decides.
The Cogno ecosystem
cogno-vox is one organ of Cogno — a family of
small, composable, Apache-2.0 libraries that together form a complete
conversational-agent platform. Each library owns a single concern and stays
infra-agnostic; a host assembles them into a running agent:
The open-source libraries are the organs; the host is the body that joins
them. Our reference host — cogno-host, with its cogno-ui dashboard — is the
private product layer, but it holds no special powers: everything it does rides
on the public seams documented in each library's docs/HOST_INTEGRATION.md, so
you can assemble a body of your own.
Develop
pip install -e ".[dev]"
pytest tests/unit -q # mocked HTTP, no network
ruff check cogno_vox && mypy cogno_vox
Live integration tests (gated, auto-skip)
tests/integration runs end-to-end against real local servers and auto-skips
unless pointed at them (same pattern as cogno-engram's ENGRAM_TEST_DSN).
Validated against fedirz/faster-whisper-server (Systran/faster-whisper-small)
and ghcr.io/remsky/kokoro-fastapi-cpu. The bundled docker-compose.yml brings
both up:
docker compose up -d # whisper :8000, kokoro :8880
VOX_TEST_WHISPER_URL=http://localhost:8000 \
VOX_TEST_KOKORO_URL=http://localhost:8880/v1 \
pytest tests/integration -q # synth (Kokoro) -> transcribe (Whisper) round-trip
See docs/HOST_INTEGRATION.md for wiring cogno-vox
onto the two edges of the pipeline.
License
Apache-2.0.
Metadata
Release files for cogno-vox 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| cogno_vox-0.1.0.tar.gz | 27.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cogno_vox-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.0 kB
Release files / cogno_vox-0.1.0.tar.gz
| Download URL | cogno_vox-0.1.0.tar.gz |
|---|---|
| Size | 27.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
021adbf54b2410e877fbd22c2e5ae209fbbcf55de57fdc91b9ae7ddab95720fd
|
|
BLAKE2b-256 checksum How to use checksums |
db0ea5e514757bab9b4a4f1ca75b203689895eadaf3fc7d15653c2910577e1cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / cogno_vox-0.1.0-py3-none-any.whl
| Download URL | cogno_vox-0.1.0-py3-none-any.whl |
|---|---|
| Size | 30.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa77fc09d8909187102b10acce57ec1ce34cbc5e22be0828c868d4505d2fb804
|
|
BLAKE2b-256 checksum How to use checksums |
562ac02374b9d7cbf41d0589c8ad262c872bef6c20fd5a4c4a3873195b810728
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for cogno-vox 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.