Skip to content

Conversation

@vnetmx
Copy link

@vnetmx vnetmx commented Jan 15, 2026

Description

Add a few improvements to Alice AI, focusing on performance optimization, Windows compatibility:

Dark Theme & UI Fixes

  • Configured DaisyUI to use dark theme as default
  • Fixed text visibility issues across dropdowns, inputs, placeholders, fieldsets, and tabs
  • Added build automation scripts (build-frontend.bat, build-full.bat, build-dev.bat)

Performance Optimization (2-3x faster STT)

  • Replaced gRPC fallback-to-CLI with native whisper-server.exe HTTP server
  • Reduced transcription time from ~700ms to ~300-400ms
  • Added WAV audio conversion utilities
  • Implemented structured logging to %APPDATA%/alice-ai-app/logs/

Windows DLL Resolution Fix

  • Fixed "spawn UNKNOWN" error on Windows by adding bin/ directory to PATH
  • Ensures proper loading of onnxruntime.dll and onnxruntime_providers_shared.dll
  • Implemented Piper gRPC service for faster TTS processing

Enhanced Infrastructure

  • Added process managers: WhisperHttpServerManager, WhisperServiceManager, LoggingManager, PiperServiceManager
  • Created comprehensive documentation for memory system, backend services, voice authentication, and custom tooling
  • Added protocol buffer compilation to build process
  • Impact: 58 files changed with major improvements to backend architecture, logging infrastructure, and cross-platform compatibility.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • [] Documentation update
  • [] Other

vnetmx and others added 4 commits January 9, 2026 18:53
- Configure DaisyUI to use dark theme by default
- Fix dropdown (select) text visibility with white text on dark background
- Fix input field text visibility for all input types
- Fix placeholder text color (gray)
- Fix fieldset legend text visibility
- Fix tab navigation text (light gray for unselected, white for selected)
- Add build automation scripts:
  * build-frontend.bat - Quick frontend-only builds
  * build-full.bat - Complete build with Go backend
  * build-dev.bat - Development mode with auto-reload

All text elements in settings dialogs now have proper contrast and visibility.

Co-authored-by: Alejandro <aleja@alicexg.local>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace gRPC fallback-to-CLI mode with native whisper-server.exe HTTP server
for persistent model loading and 2-3x faster transcription performance.

## Key Changes

### Backend (Go)
- Add HTTP client for whisper-server.exe communication
- Create audio_utils.go with WAV conversion helpers
- Add gRPC service implementation (legacy fallback)
- Update STT service with HTTP > gRPC > CLI priority chain
- Update model manager to initialize HTTP mode via env vars
- Add protocol buffer definitions for gRPC service

### Electron Process Management
- Add WhisperHttpServerManager for whisper-server.exe lifecycle
- Add WhisperServiceManager for gRPC service (legacy)
- Add LoggingManager for file-based Electron logging
- Update BackendManager with intelligent stderr filtering
- Update main process to start whisper-server before Go backend
- Configure HTTP mode via environment variables

### Performance Improvements
- Model loads once at startup (not per-request)
- Transcription: ~300-400ms (was ~700ms with CLI mode)
- Eliminates ~200ms model loading overhead per request
- Supports chunked audio for future realtime processing

### Logging & Debugging
- All Electron logs written to %APPDATA%/alice-ai-app/logs/
- Backend logs written to resources/backend/logs/
- Whisper server logs written to resources/backend/bin/logs/
- Intelligent filtering: only actual errors shown in console
- HTTP request logs kept in backend files only

### Build System
- Add protocol buffer compilation step to build-full.bat
- Update build-go.js for new dependencies
- Update package.json with required dependencies

### Documentation
- Add memory system architecture documentation
- Add backend service analysis documentation
- Add voice authentication feature specs
- Add custom tooling system documentation

## Architecture

**New Flow:**
Frontend Audio → Go Backend → whisper-server.exe (HTTP) → Pre-loaded model → Fast response

**Fallback Chain:**
HTTP mode → gRPC mode → CLI mode (automatic degradation)

## Configuration

Set via environment variables (auto-configured by Electron):
- WHISPER_USE_HTTP=true (enables HTTP mode)
- WHISPER_HTTP_ADDR=http://localhost:8082
- Whisper server runs on port 8082
- Main backend runs on port 8765

## Testing

Verified:
- ✅ Whisper HTTP server starts successfully
- ✅ Model loads from correct absolute path
- ✅ HTTP mode is used for transcription
- ✅ Performance improvement confirmed (~400ms vs ~700ms)
- ✅ Graceful shutdown of all services
- ✅ Clean log output without HTTP noise

Co-authored-by: Alejandro <aleja@alicexg.local>
Fixes the "spawn UNKNOWN" error when starting Go backend services on Windows.

Changes:
- Add bin/ directory to PATH in backendManager.ts and piperServiceManager.ts
  to ensure Windows can find onnxruntime.dll and onnxruntime_providers_shared.dll
- Implement Piper gRPC service for faster TTS processing
- Add piper-service build step to build-go.js
- Add piperServiceManager to manage Piper gRPC service lifecycle
- Integrate Piper gRPC client in backend models manager

The PATH fix resolves DLL loading issues that prevented the Go backend
from starting on Windows systems.
Sync repo
@pmbstyle pmbstyle self-requested a review January 16, 2026 13:17
Copy link
Owner

@pmbstyle pmbstyle left a comment

Choose a reason for hiding this comment

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

@vnetmx thank you for your contribution. This PR has several valuable parts but also introduces patterns that don't fit Alice's architecture as an Electron desktop app.

Concerns

  1. Dark Theme & UI Fixes section.
    What problem are these fixes trying to solve? Have you encountered issues with dark mode or UI colors chema? If so, it would be very helpful to see examples of those issues.
    "Added build automation scripts (build-frontend.bat, build-full.bat, build-dev.bat)" - why this was added.
// package.json already has:
"build": "npm run build:go && vite build && npx electron-builder"

The npm run build command already handles Go compilation, frontend build, and Electron bundling. What do the new .bat scripts provide that isn't already covered? These scripts treat components as separate (web frontend, backend services) when Electron bundles everything into one desktop app. There is some code and build logic related, but that's more like a candidate for clean-up.

  1. Separating STT/TTS services into separate gRPC servers, exposing http API can be a good way to do things for a web app. But this adds overhead (HTTP/gRPC stacks) for same-machine communication. What problem does gRPC solve that can't be handled with the existing internal service coordination?

  2. Documentation
    I'm not entirely sure if there is a reason to support extensive developer documentation. This can be generated for a coding agent without the need for extra context (one document, such as CLAUDE.md, which is compact and contains everything needed). Hosting docs separately brings more maintenance issues than solving an actual problem.

What's Good

  1. Windows PATH Fix
  // backendManager.ts - THIS IS CORRECT
  const binDir = path.join(backendDir, 'bin')
  const updatedPath = `${binDir}${pathSeparator}${process.env.PATH || ''}`

Why: This fixes the ONNX Runtime DLL loading issue on Windows. This is a legitimate bug fix.

  1. Logging Infrastructure
  // loggingManager.ts - THIS IS USEFUL
  electron/main/loggingManager.ts
  1. AWS Bedrock Integration (Good, if needed)
  src/services/llmProviders/bedrock.ts

Why: Adding a new LLM provider is a valid functionality.

Recommended Actions

Please Keep:

  • Windows PATH fix (with explanation of the DLL issue it solves)
  • Logging infrastructure (valuable for debugging)
  • AWS Bedrock integration (if users want this provider)

Please Remove:

  • All gRPC service code (backend/cmd/*-service/, backend/internal/grpc/, backend/proto/)
  • Whisper HTTP server (whisperHttpServerManager.ts)
  • Separate build scripts (build-*.bat)

Please Clarify:

  • Dark theme fixes (show examples or explain the problem)

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