โ† Back to blog

Building CoHost.AI โ€“ An AI Voice Companion for Twitch Streams

6/8/2025ยท3 min readPythonLLMTTSStreamer.botOllamaGoogle CloudOBS

๐ŸŽ™๏ธ Building CoHost.AI โ€“ An AI Voice Companion for Twitch Streams

I like messing around with AI. I thought it'd be fun to build something dumb, simple, and interactive โ€” something my chat could play with too.

So I built CoHost.AI.

๐ŸŽฏ What It Does

It listens to either:

  • ๐ŸŽค My mic (using push-to-talk), or
  • ๐Ÿ’ฌ Twitch chat messages (via channel point redemptions)

Then it:

  1. Sends the message to a local LLM (using Ollama)
  2. Gets a response from the AI
  3. Converts that to speech (with Google Cloud TTS)
  4. Plays it back through OBS
  5. Shows a character on screen while it's talking, then hides it again when done

That's it. It's not a VTuber. It's not a chatbot. It's just a reactive stream gremlin that says dumb stuff in an AI voice โ€” and I love it.

๐Ÿงฐ Tech Stack (The Short Version)

Component What it does
Python All core logic
Ollama Local LLM inference
Google Cloud TTS Converts text to speech
OBS Studio Plays audio + toggles character
Streamer.bot Captures chat redemptions via UDP
SpeechRecognition Push-to-talk mic input

OBS uses WebSockets to toggle visibility on a character source when the bot talks. With the OBS Move plugin, animations can be added to the character. Works great live.

๐Ÿ”ง How It Works

๐ŸŽค or ๐Ÿ’ฌ โ†’ Python โ†’ Ollama โ†’ Google TTS โ†’ OBS + Audio Out

Simple flow: You talk or chat redeems โ†’ response is generated โ†’ it talks โ†’ character appears โ†’ disappears. Done.

๐Ÿง  Custom Personality

There's a system_prompt.txt file where you define the AI's tone. You can make it sassy, sweet, helpful, or a complete menace.

I use mine to keep responses short, stream-appropriate, and kinda sarcastic.

๐Ÿšง Why I Built It

Mostly for fun. Partially to mess with AI and TTS. But also because chat interactions are one of the best parts of streaming, and this gave them a new way to get involved.

Plus it's hilarious when the bot roasts someone or says something weird that becomes a running joke.

โš™๏ธ Setup

Quick start:

  1. Clone the repo โ†’ GitHub
  2. Set up Python, Ollama, and Google Cloud
  3. Configure .env
  4. Run it with python run.py
  5. Push-to-talk or redeem a chat message โ†’ bot replies

๐ŸŽฌ Try It

Links:
๐Ÿ‘‰ GitHub Repository
๐ŸŽฎ See it live on Twitch

๐Ÿ’ญ Final Thoughts

CoHost.AI doesn't do everything. It just listens, replies, and appears on screen. But it makes my stream more fun, and that's all I wanted.

If you're into AI stuff, stream tech, or just want to build something weird and entertaining โ€” feel free to fork it, break it, or make it yours.

That's the fun of it.