Skip to content

Kokoro tts#5

Merged
ashum9 merged 3 commits into
mofa-org:platformfrom
ashum9:kokoro-tts
Jul 22, 2026
Merged

Kokoro tts#5
ashum9 merged 3 commits into
mofa-org:platformfrom
ashum9:kokoro-tts

Conversation

@ashum9

@ashum9 ashum9 commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Adds a local OpenAI-compatible TTS server using Kokoro ONNX.
Runs offline on CPU, port 8421. Handles Chinese text chunking (25 char limit for phoneme constraints) and auto-maps OpenAI voice names via af_ prefix. Includes mofa_hybrid.toml production config with Ollama + Kokoro providers.

Enables the existing mofa-fm pipeline to run fully offline no API key, no internet.

Copilot AI review requested due to automatic review settings July 8, 2026 07:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a local, offline Kokoro-based OpenAI-compatible TTS bridge and adds a new mofa-observability workspace crate that defines an event schema, in-memory metrics collection, and Prometheus text rendering, plus a mock harness and Grafana/Prometheus docker setup for validation.

Changes:

  • Add kokoro_tts_server.py and a production mofa_hybrid.toml config wiring an OpenAI-compatible “kokoro” provider at http://127.0.0.1:8421/v1.
  • Add mofa-observability crate with event types, metrics collector, and Prometheus text exposition renderer (with tests).
  • Add docker-compose + Grafana dashboards + Prometheus config to exercise and visualize the new metrics via a mock harness.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
mofa-observability/src/prometheus.rs Implements Prometheus text exposition rendering + tests.
mofa-observability/src/lib.rs Exposes observability crate modules.
mofa-observability/src/events.rs Defines the engine event schema used for telemetry.
mofa-observability/src/collector.rs In-memory metrics state + collector loop and channel abstraction.
mofa-observability/examples/mock_harness.rs Axum-based mock event generator + /metrics endpoint.
mofa-observability/docker/prometheus/prometheus.yml Prometheus scrape config for the mock harness container.
mofa-observability/docker/grafana/provisioning/datasources/prometheus.yml Grafana datasource provisioning for Prometheus.
mofa-observability/docker/grafana/provisioning/dashboards/dashboards.yml Grafana dashboard provisioning configuration.
mofa-observability/docker/Dockerfile Builds and packages the mock harness into a container image.
mofa-observability/docker/docker-compose.yml Spins up mock harness + Prometheus + Grafana locally.
mofa-observability/dashboards/preflight_routing.json Grafana dashboard for preflight/routing-related metrics.
mofa-observability/dashboards/memory_lifecycle.json Grafana dashboard for memory/model lifecycle metrics.
mofa-observability/dashboards/engine_overview.json Grafana dashboard for high-level engine health/latency views.
mofa-observability/Cargo.toml Declares the new observability crate’s dependencies.
mofa_hybrid.toml Adds a hybrid production config including the Kokoro provider.
kokoro_tts_server.py Local OpenAI-compatible TTS HTTP server bridging to Kokoro ONNX.
Cargo.toml Adds mofa-observability to the workspace members.
Cargo.lock Locks new crate/dependency additions (incl. mofa-observability, rand).
.gitignore Ignores .kokoro-models/ directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mofa-observability/Cargo.toml Outdated
Comment thread mofa-observability/src/collector.rs Outdated
Comment thread mofa-observability/src/events.rs Outdated
Comment thread mofa-observability/dashboards/preflight_routing.json Outdated
Comment thread mofa-observability/dashboards/preflight_routing.json Outdated
Comment thread kokoro_tts_server.py Outdated
Comment thread kokoro_tts_server.py
Comment thread mofa-observability/docker/Dockerfile Outdated
@ashum9
ashum9 changed the base branch from main to platform July 22, 2026 22:13
@ashum9
ashum9 merged commit b2c6ad7 into mofa-org:platform Jul 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants