๐๏ธ 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:
- Sends the message to a local LLM (using Ollama)
- Gets a response from the AI
- Converts that to speech (with Google Cloud TTS)
- Plays it back through OBS
- 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:
- Clone the repo โ GitHub
- Set up Python, Ollama, and Google Cloud
- Configure
.env
- Run it with
python run.py
- 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.