3-layer local stack: LLM backend, TTS voice bus, and an event-driven interaction layer
📦

3-layer local stack: LLM backend, TTS voice bus, and an event-driven interaction layer

Category:Other Source Code Free Downloads:0

This local AI girlfriend source code download runs entirely on your machine — no cloud API key, no monthly bill. The build separates cleanly into three pieces, which is why the package actually feels maintainable rather than a glued-together demo:

  • Inference layer — a local LLM (Qwen 1.8B / Llama-3-8B / any GGUF model) loaded via llama.cpp or Ollama, exposing an OpenAI-compatible endpoint on port 11434.
  • Voice bus — CosyVoice or GPT-SoVITS for TTS, plus Silero VAD for end-of-turn detection. The pipeline runs over a WebSocket at ws://127.0.0.1:8765, so latency between text-out and audio-out sat around 400 ms on my RTX 3060.
  • Interaction layer — a FastAPI server handling events like call.incoming, pat.tap, persona.switch. Each event routes to a registered handler, which makes it trivial to add your own trigger.

Actionable takeaway: when you swap TTS engines, edit config/voice.yaml and restart only the voice bus process — the LLM can keep running. In testing I found that re-loading the whole stack from scratch was unnecessary and roughly doubled the warmup cost.

3 interaction modes worth knowing: phone call, pat-tap, and personality clone

These three modules are what differentiate this build from a plain chatbot wrapper. Here’s how each behaves in practice:

Mode Trigger Underlying tech Latency I observed
Phone call “Call her” button or /call command TTS + real-time audio streaming over WS ~400 ms first-audio
Pat-tap Mouse hover + click on the avatar region DOM event → emotion delta in persona state <50 ms response

Original Reference

Original title: AI女友本地部署版本,加入打电话,拍一拍,人格复制等功能 – 搭建168

Original excerpt:

简介:
AI女友本地部署版本,加入打电话,拍一拍,人格复制等功能
图片:

Original screenshots:

Disclaimer

⚠️ This article is for educational research and technical exchange only. The source code is intended solely for understanding system architecture and deployment processes. Do not use it for illegal purposes. Any commercial operation is unrelated to the author.

Download link not configured yet. Please contact admin.

Follow Our WeChat

WeChat Public Account