Skip to content

Architecture

One engine, five implementations, one contract. This page maps what each layer may depend on, and where a concept lives in every language.

Dependencies point downwards only, with one sanctioned exception: config and frontend.chunking are mutually dependent by design (a lazy import breaks the cycle), and contracts reaches config and voice. The direction is enforced, not conventional. tests/test_import_graph.py parses every module and fails on an undeclared edge.

errors · contracts · provenance · rng · timing foundation
checkpoint · postprocess release layout on disk;
│ artifact guards
hub · config · frontend/ release resolution; algorithm
│ knobs; the text funnel
│ (numbers, dates, letters,
▼ chunking, polish, text,
voice · sampler textconfig)
models/ · backends/ signal & network modules
│ (flow, generator, vocoder,
│ enroll, resample, noise,
▼ windowing, timestretch)
engine orchestration: one synthesis path
synthesis render_bytes: the only place
│ audio is made; transport-agnostic
transports/ http · mcp · grpc three adapters, peers, never
│ layered on one another
cli

A row is a level, not a promise about its members. config and frontend/ share one because of the sanctioned cycle, and backends/ reaches sideways into models/ and lazily back up into engine. The allowlist is the exact statement; this is the shape.

Rules with teeth:

  • frontend/* never imports the engine, a backend or packaging.
  • models/* never imports the frontend.
  • postprocess knows nothing about config. The configuration reads the detectors, never the other way round.
  • hub never imports the engine or a transport. Release resolution has to work before any weights exist.
  • A transport importing a peer, or the cli, fails the suite.
  • Adding any edge means adding it to the allowlist in the same commit.

Python is the reference. The other four are full implementations held to the same conformance fixture (tests/data/conformance/). Layouts differ by ecosystem idiom; names do not.

conceptPythonRustGoTypeScriptSwift
numbers grammarfrontend/numbers.pysrc/numbers.rsspeechtext/numbers.gosrc/numbers.tsLoudKitText/Numbers.swift
date rulesfrontend/dates.pysrc/dates.rsspeechtext/dates.gosrc/dates.tsLoudKitText/Dates.swift
letter namesfrontend/letters.pysrc/letters.rsspeechtext/letters.gosrc/letters.tsLoudKitText/Letters.swift
sentence splittingfrontend/chunking.pysrc/chunking.rschunking/chunking.gosrc/chunking.tsLoudKit/Chunking.swift
artifact guardspostprocess.pysrc/postprocess.rspostprocess/postprocess.gosrc/postprocess.tsLoudKit/Postprocess.swift
text funnel driverfrontend/polish.pysrc/speechtext.rsspeechtext/speechtext.gosrc/speechText.tsLoudKit/TextFrontend.swift
sampler (Philox)sampler.pysrc/sampler.rssampler/sampler.gosrc/sampler.tsLoudKit/Sampler.swift
RNG corerng.pysrc/rng.rsrng/rng.gosrc/rng.tsLoudKit/Philox.swift
engine orchestrationengine.pysrc/engine.rsengine/engine.gosrc/engine.tsLoudKit/Engine.swift
voice profilesvoice.pysrc/voice.rsvoice/voice.gosrc/voice.tsLoudKit/VoiceProfile.swift
release resolutionhub.pysrc/checkpoint.rscheckpoint/src/checkpoint.tsLoudKit/Checkpoint.swift
provenance manifestsprovenance.pyn/an/an/an/a
synthesis surfacesynthesis.pyn/a¹n/a¹n/a¹n/a¹
HTTP / MCP / gRPC adapterstransports/n/a²n/a²n/a²n/a²

¹ Server-only surfaces. The ports ship libraries and thin CLIs, which is why their main entry points are a hundred-odd lines. ² Python-only by definition: the other languages have no server to adapt.

  1. docs/reference/IDENTITY-CONTRACT.md: what “same input, same audio” means here, precisely.
  2. python/loudkit/engine.py: the synthesis path everything shares.
  3. Any file in this table, in the language you will work in. Its header names its Python reference.