Skip to content

adityars07/mofa-studio

Β 
Β 

Repository files navigation

MoFA Studio

AI-powered desktop voice chat application built with Rust and Makepad

License Rust

MoFA Studio is a modern, GPU-accelerated desktop application for AI voice chat and model management. Built entirely in Rust using the Makepad UI framework, it provides a beautiful, responsive interface with native performance.

MoFA Studio

✨ Features

  • 🎨 Beautiful UI - GPU-accelerated rendering with smooth animations
  • πŸŒ“ Dark Mode - Seamless light/dark theme switching with animated transitions
  • πŸŽ™οΈ Audio Management - Real-time microphone monitoring and device selection
  • πŸ”Œ Modular Architecture - Plugin-based app system for extensibility
  • βš™οΈ Provider Configuration - Manage multiple AI service providers (OpenAI, DeepSeek, Alibaba Cloud)
  • πŸ“Š Real-time Metrics - CPU, memory, and audio buffer monitoring
  • πŸš€ Native Performance - Built with Rust for maximum efficiency

πŸ—οΈ Architecture

MoFA Studio uses a modular workspace structure:

mofa-studio/
β”œβ”€β”€ mofa-studio-shell/      # Main application shell
β”œβ”€β”€ mofa-widgets/           # Shared reusable widgets
└── apps/
    β”œβ”€β”€ mofa-fm/            # Voice chat interface
    └── mofa-settings/      # Provider configuration

Key Design Principles

  • Plugin System - Apps implement the MofaApp trait for standardized integration
  • Black-Box Apps - Apps are self-contained with no shell coupling
  • Theme System - Centralized color and font management
  • Makepad Native - Leverages Makepad's GPU-accelerated immediate-mode UI

See ARCHITECTURE.md for detailed system design.

πŸš€ Quick Start

Using Nix? See DEPLOY_WITH_NIX.md for automated deployment with ./run.sh

Prerequisites

  • Rust 1.70+ (2021 edition)
  • Cargo package manager
  • Git for cloning the repository

Voice Chat Prerequisites

To run the voice chat dataflow, you need to set up the Python environment and download the required AI models.

1. Environment Setup

cd models/setup-local-models
./setup_isolated_env.sh

This creates a conda environment mofa-studio with:

  • Python 3.12
  • PyTorch 2.2.0, NumPy 1.26.4, Transformers 4.45.0

2. Install All Packages

After the conda environment is created, install all Python and Rust components:

conda activate mofa-studio
./install_all_packages.sh

This installs:

  • Shared library: dora-common
  • Python nodes: dora-asr, dora-primespeech, dora-speechmonitor, dora-text-segmenter
  • Rust nodes: dora-maas-client, dora-conference-bridge, dora-conference-controller
  • Dora CLI

Verify installation:

python test_dependencies.py

3. Model Downloads

cd models/model-manager

# ASR models (FunASR Paraformer + punctuation)
python download_models.py --download funasr

# PrimeSpeech TTS (base + voices)
python download_models.py --download primespeech

# List available voices
python download_models.py --list-voices

# Download specific voice
python download_models.py --voice "Luo Xiang"

Models are stored in:

Location Contents
~/.dora/models/asr/funasr/ FunASR ASR models
~/.dora/models/primespeech/ PrimeSpeech TTS base + voices

4. API Keys (Optional)

For LLM inference, set your API keys in the MoFA Settings app or via environment variables: (You may also enter it in the MoFA Studio's Settings UI page later)

export OPENAI_API_KEY="your-key"
export DEEPSEEK_API_KEY="your-key"
export ALIBABA_CLOUD_API_KEY="your-key"

Build & Run

# Clone the repository
git clone https://github.com/mofa-org/mofa-studio.git
cd mofa-studio

# Build in release mode
cargo build --release

# Run the application
cargo run --release

The application window will open at 1400x900 pixels by default.

Development Build

# Fast debug build
cargo build

# Run with debug logging
RUST_LOG=debug cargo run

Run Voice Chat Dataflow

MoFA Studio uses Dora for voice chat dataflow orchestration. Each app can have its own dataflow configuration.

# Navigate to app's dataflow directory
cd apps/mofa-fm/dataflow

# Start the Dora daemon
dora up

# Start the dataflow (packages already installed via install_all_packages.sh)
dora start voice-chat.yml

# Check running dataflows
dora list

# Stop dataflow
dora stop <dataflow-id>

The node-hub/ directory contains all Dora nodes used by the dataflows:

Node Type Description
dora-maas-client Rust LLM inference via MaaS APIs
dora-conference-bridge Rust Text routing between participants
dora-conference-controller Rust Turn-taking and policy management
dora-primespeech Python TTS synthesis with multiple voices
dora-text-segmenter Python Text segmentation for TTS
dora-asr Python Speech recognition (Whisper/FunASR)
dora-common Python Shared logging utilities

πŸ“¦ Project Structure

MoFA Studio is organized as a Cargo workspace with 5 crates:

Crate Type Description
mofa-studio-shell Binary Main application shell with window chrome and navigation
mofa-widgets Library Shared UI components (theme, audio player, waveforms, etc.)
mofa-fm Library Voice chat interface app
mofa-settings Library Provider configuration app

Key Files

🎯 Current Status

MoFA Studio is currently a UI prototype with working components:

βœ… Implemented

  • Full UI navigation and theming
  • Audio device selection and monitoring
  • Provider configuration persistence
  • Dark/light mode with animations
  • Plugin app system

🚧 Planned

  • WebSocket client for AI service integration
  • Live ASR (speech recognition) integration
  • Live TTS (text-to-speech) integration
  • LLM chat completion
  • Real-time conversation flow

πŸ› οΈ Creating a New App

MoFA Studio's plugin system makes it easy to add new functionality:

// 1. Implement the MofaApp trait
impl MofaApp for MyApp {
    fn info() -> AppInfo {
        AppInfo {
            name: "My App",
            id: "my-app",
            description: "My custom app"
        }
    }

    fn live_design(cx: &mut Cx) {
        screen::live_design(cx);
    }
}

// 2. Create your screen widget
live_design! {
    pub MyAppScreen = {{MyAppScreen}} {
        width: Fill, height: Fill
        // Your UI here
    }
}

See APP_DEVELOPMENT_GUIDE.md for step-by-step instructions.

πŸ“š Documentation

Document Description
ARCHITECTURE.md System architecture, widget hierarchy, best practices
APP_DEVELOPMENT_GUIDE.md Creating apps, plugin system, dark mode support
STATE_MANAGEMENT_ANALYSIS.md Why Redux/Zustand don't work in Makepad
CHECKLIST.md P0-P3 refactoring roadmap (all complete)

πŸ”§ Technology Stack

  • Rust - Systems programming language
  • Makepad - GPU-accelerated UI framework
  • CPAL - Cross-platform audio I/O
  • Tokio - Async runtime
  • Serde - Serialization framework

🀝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Development Setup

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Test thoroughly (cargo test, cargo build)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

πŸ“ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Copyright 2026 MoFA Studio Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

πŸ™ Acknowledgments

  • Makepad - For the incredible GPU-accelerated UI framework
  • Dora Robotics Framework - Original inspiration for voice chat architecture
  • Rust Community - For excellent tooling and libraries

πŸ“§ Contact


Built with ❀️ using Rust and Makepad

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 56.2%
  • Python 42.1%
  • Shell 1.2%
  • Other 0.5%