Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LM Studio Talker

LM Studio Talker is a Python-based tool designed for fast, low-latency voice conversations with LLMs hosted locally via LM Studio.

It supports two operating modes:

  • Fast Performance: Prioritizes low latency using optimized STT models and fast TTS.
  • High Quality: Prioritizes audio quality (configurable).

The tool can be run natively on your host machine (optimized for Apple Silicon/M-series) or within a Docker container.

Features

  • 🎙️ Voice Interaction: Real-time Speech-to-Text (STT) and Text-to-Speech (TTS).
  • 🚀 Low Latency: Streaming responses from LLM and optimized audio pipeline.
  • 🐳 Docker Support: Full containerization for easy deployment.
  • ⚙️ Configurable: Toggle between Speed and Quality modes.

Prerequisites

  1. LM Studio: Download and install LM Studio.
  2. Local Server: Start the Local Inference Server in LM Studio (default port 1234).
  3. Python 3.10+ (if running locally).

Installation & Usage

Option 1: Run Locally (Recommended for Mac M1/M2/M3)

  1. Clone the repository:

    git clone https://github.com/yourusername/LMStudioTalker.git
    cd LMStudioTalker
  2. Set up Virtual Environment:

    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt

    Note: On Linux, you may need system dependencies like portaudio19-dev and espeak.

  3. Run the Tool:

    python src/main.py --language pl
    # Or for fast mode
    python src/main.py --language en --fast

    Ensure your microphone and speakers are active.

Option 2: Run with Docker

  1. Build the Image:

    docker build -t lm-studio-talker .
  2. Run the Container: Audio device access from Docker varies by OS.

    Linux / Native:

    docker run --rm -it \
      --device /dev/snd \
      --network host \
      lm-studio-talker

    Mac/Windows: Docker Desktop has limited access to host audio hardware. It is recommended to run the Python script natively on these platforms for voice support. Passing audio devices to Docker on Mac requires PulseAudio/Socket trickeries.

Configuration

Edit src/config.py to change settings:

class AppConfig(BaseModel):
    # LM Studio URL
    lm_studio_base_url: str = "http://127.0.0.1:1234/v1"
    
    # Performance Mode (True = Faster, False = Better Quality)
    fast_mode: bool = True 

Tech Stack

  • LLM Client: openai (Python SDK)
  • STT: faster-whisper
  • TTS: pyttsx3
  • Audio I/O: sounddevice

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages