Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
617b2f4
Update README.md
rajarshiroy-nvidia Jan 15, 2026
1def0c6
Update README.md
rajarshiroy-nvidia Jan 16, 2026
1535caa
add containerized support for personaplex
Jan 16, 2026
261cbe6
Merge pull request #1 from tuttlebr/btuttle/container-build
rajarshiroy-nvidia Jan 16, 2026
62ae4f7
Temporary fix for HF downloads tracking.
rajarshiroy-nvidia Jan 18, 2026
e4e8f4c
Update README.md
rajarshiroy-nvidia Jan 20, 2026
0947e85
Install build dependencies and libopus-dev to fix Docker build
wachawo Jan 22, 2026
b0b78e4
Removed unused dependencies
wachawo Jan 22, 2026
828e15f
Update README.md to update permanent discord link and installation fi…
rajarshiroy-nvidia Jan 23, 2026
195768c
Merge pull request #7 from wachawo/main
rajarshiroy-nvidia Jan 23, 2026
84e209c
Add custom voice support and fix Blackwell GPU compatibility
kiralpoon Jan 23, 2026
aaa0692
Add --cpu-offload flag for both server and offline modes, which offlo…
grafael Jan 23, 2026
ce22eeb
docs: add mention of opus dependency
jaycoolh Jan 23, 2026
0eda307
Update README.md
rajarshiroy-nvidia Jan 23, 2026
f97974b
Update README.md
rajarshiroy-nvidia Jan 23, 2026
20e9dc4
Merge pull request #15 from jaycoolslm/docs/add-opus-prereq
rajarshiroy-nvidia Jan 23, 2026
2e6b4e4
Merge pull request #14 from grafael/cpu_offload
rajarshiroy-nvidia Jan 23, 2026
c9f6d0a
Update README.md
rajarshiroy-nvidia Jan 23, 2026
0c3dd8b
fix: reduce memory need during model init
tsdocode Jan 23, 2026
7f364f0
Merge origin/main: integrate cpu-offload with custom voice support
kiralpoon Jan 24, 2026
49e3d0a
Merge pull request #18 from tsdocode/fix/init-oom
rajarshiroy-nvidia Jan 24, 2026
0d0f898
Add .env file support for HF_TOKEN configuration
kiralpoon Jan 26, 2026
ca452ae
Merge upstream/main: reduce memory need during model init
kiralpoon Jan 26, 2026
8743e63
Add dynamic custom voice system with automatic Web UI discovery
kiralpoon Jan 26, 2026
645dd0b
Add smart auto-detection for custom UI builds
kiralpoon Jan 27, 2026
ca04965
Add dynamic custom voice system with automatic Web UI discovery
kiralpoon Jan 26, 2026
b728bfc
Add smart auto-detection for custom UI builds
kiralpoon Jan 27, 2026
a2d59cb
Remove .env documentation from PR
kiralpoon Jan 27, 2026
d68aff1
Add Example Usage section to README
kiralpoon Jan 27, 2026
86174a9
Merge pr-ui-and-voice-features into main
kiralpoon Jan 27, 2026
9c06c41
Add .env file support for easier token management
kiralpoon Jan 27, 2026
e38d377
Add .gitignore rules for Claude Code tooling files
kiralpoon Jan 27, 2026
b39131a
Merge upstream/main: integrate latest changes with our features
kiralpoon Jan 27, 2026
d397aea
Merge test-merge-branch: integrate upstream changes with our features
kiralpoon Jan 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# PersonaPlex Environment Configuration
# Copy this file to .env and fill in your values

# Hugging Face API Token (Required)
# Get your token from: https://huggingface.co/settings/tokens
# Required to download PersonaPlex models
HF_TOKEN=your_token_here

# Optional: Custom voices directory
# Specify a custom location for your voice embeddings
# CUSTOM_VOICE_DIR=/path/to/my/voices

# Optional: Custom cache directory for Hugging Face models
# By default, models are cached in ~/.cache/huggingface/
# HF_HOME=/path/to/custom/cache
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,14 @@ mlx-trace.json
# Include everything in assets
!assets/
!assets/**

# Custom voice files (keep directory structure in git, ignore voice files)
custom_voices/*.pt
custom_voices/*.wav
# But keep the README
!custom_voices/README.md

# Claude Code and personal tooling files (should never be committed)
.agent/
Agents.md
Claude.local.md
284 changes: 284 additions & 0 deletions FRONTEND_DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
# Frontend Development Guide

This guide explains how to develop and test custom UI changes for PersonaPlex.

## Understanding Smart Auto-Detection

**PersonaPlex now automatically detects and serves your custom UI!** You no longer need to use the `--static` flag for development.

### How Auto-Detection Works

When you start the server, it checks:
1. Does `client/dist` exist in the project directory?
2. **YES** → Automatically serves your custom UI
3. **NO** → Downloads and serves the default UI from HuggingFace

### Starting the Server (Auto-Detection)

```bash
# Just start the server normally - no flags needed!
conda activate personaplex
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR"
```

**Log output with custom UI detected:**
```
Found custom UI at /home/.../personaplex-blackwell/client/dist, using it instead of default
static_path = /home/.../personaplex-blackwell/client/dist
serving static content from /home/.../personaplex-blackwell/client/dist
```

**Log output without custom UI:**
```
retrieving the static content
static_path = /home/.../.cache/huggingface/.../dist
serving static content from /home/.../.cache/huggingface/.../dist
```

### Manual Override (Optional)

You can still manually specify the UI source if needed:

```bash
# Force specific directory
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR" --static /path/to/custom/dist

# Disable static serving
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR" --static none
```

## Frontend Development Workflow

### Prerequisites

1. Install Node.js and npm (if not already installed):
```bash
# Check if already installed
node --version
npm --version
```

2. Install frontend dependencies:
```bash
cd client
npm install
```

### Development Steps (Simplified!)

#### 1. Make Your Changes
Edit files in the `client/src/` directory:
- `client/src/components/` - React components
- `client/src/styles/` - CSS and styling
- `client/src/App.tsx` - Main application component

#### 2. Build the Frontend
```bash
cd client
npm run build
cd ..
```

This creates/updates the `client/dist` directory with your compiled code.

#### 3. Start Server (Auto-Detection!)
```bash
# From project root - server auto-detects custom UI!
conda activate personaplex
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR"
```

#### 4. Verify Custom UI is Loaded
Check the server logs for:
```
Found custom UI at .../client/dist, using it instead of default
static_path = /home/.../personaplex-blackwell/client/dist
```

If you see `retrieving the static content`, the build might not exist. Go back to step 2.

#### 5. Test Your Changes
1. Open the Web UI: https://localhost:8998
2. Hard refresh (Ctrl+Shift+R or Cmd+Shift+R) to clear browser cache
3. Test your modifications

#### 6. Iterate
Repeat steps 1-5 for each change:
```bash
# Make changes to client/src/...
cd client && npm run build && cd ..

# Restart server (Ctrl+C to stop first) - auto-detects custom UI!
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR"
```

**That's it! No `--static` flag needed anymore.**

## Troubleshooting

### Changes Not Appearing

**Problem:** You rebuilt the frontend but don't see changes in the browser.

**Solutions:**
1. **Verify server is using custom UI:**
- Check logs for `static_path = client/dist`
- If not, restart with `--static client/dist`

2. **Clear browser cache:**
- Hard refresh: Ctrl+Shift+R (Windows/Linux) or Cmd+Shift+R (Mac)
- Or open DevTools (F12) → Network tab → Check "Disable cache"

3. **Verify build completed successfully:**
```bash
cd client
npm run build
ls -la dist/ # Should show recent timestamps
```

4. **Check for build errors:**
```bash
cd client
npm run build 2>&1 | grep -i error
```

### Server Won't Start with --static Flag

**Problem:** Error when starting server with `--static client/dist`

**Solutions:**
1. **Verify dist directory exists:**
```bash
ls -la client/dist/
```
If missing, build the frontend first: `cd client && npm run build`

2. **Check path is correct:**
- Use relative path: `--static client/dist`
- From project root, not from client/ directory

### Frontend Build Fails

**Problem:** `npm run build` fails with errors

**Solutions:**
1. **Check Node.js version:**
```bash
node --version
# Should be 16.x or higher
```

2. **Reinstall dependencies:**
```bash
cd client
rm -rf node_modules package-lock.json
npm install
npm run build
```

3. **Check for TypeScript errors:**
```bash
cd client
npm run type-check
```

## Development Tips

### Shell Alias for Quick Development
Add to your `~/.bashrc` or `~/.zshrc`:

```bash
# Quick start with custom UI
alias moshi-dev='conda activate personaplex && SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR" --static client/dist'

# Quick frontend rebuild
alias moshi-build='cd client && npm run build && cd ..'
```

Usage:
```bash
# Make changes to client/src/...
moshi-build # Rebuild frontend
moshi-dev # Start server with custom UI
```

### Watch Mode for Live Development

For faster iteration, use the frontend in development mode:

```bash
# Terminal 1: Start backend server (without static flag)
conda activate personaplex
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR"

# Terminal 2: Start frontend dev server with hot reload
cd client
npm run dev
```

Then access the UI at the Vite dev server URL (usually http://localhost:5173).

**Note:** This requires configuring CORS in the backend. Check `client/vite.config.ts` for proxy settings.

## Production Deployment

When ready to deploy your custom UI:

1. Build the production bundle:
```bash
cd client
npm run build
```

2. Test the production build:
```bash
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR" --static client/dist
```

3. Verify everything works correctly

4. Commit your changes:
```bash
git add client/src/ client/dist/
git commit -m "Add custom UI feature: [description]"
```

## File Structure

```
personaplex-blackwell/
├── client/ # Frontend source code
│ ├── src/ # Source files (edit these)
│ │ ├── components/ # React components
│ │ ├── styles/ # CSS files
│ │ ├── App.tsx # Main app
│ │ └── main.tsx # Entry point
│ ├── dist/ # Built files (generated)
│ │ ├── index.html # HTML entry
│ │ ├── assets/ # JS/CSS bundles
│ │ └── ...
│ ├── package.json # Dependencies
│ ├── vite.config.ts # Build config
│ └── tsconfig.json # TypeScript config
└── moshi/ # Backend Python code
```

## Quick Reference

| Task | Command |
|------|---------|
| Install dependencies | `cd client && npm install` |
| Build frontend | `cd client && npm run build` |
| Start with custom UI | `SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR" --static client/dist` |
| Start with default UI | `SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR"` |
| Dev server (hot reload) | `cd client && npm run dev` |
| Type check | `cd client && npm run type-check` |
| Lint code | `cd client && npm run lint` |

## Getting Help

If you encounter issues not covered here:
1. Check [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for common problems
2. Verify your Node.js and npm versions
3. Check the browser console (F12) for JavaScript errors
4. Review server logs for static file serving errors
Loading