Skip to main content

GLaDOS Chat Library — Usage Guide

Talk with GLaDOS (Portal 2 style) via Ollama + Piper TTS + Whisper STT, either in your terminal or in Python scripts.


Features

  • Interactive Chatting
    • One-shot answers or sentence-by-sentence streaming.
  • Text-to-Speech (TTS)
    • Uses Piper with the GLaDOS voice model.
  • Speech-to-Text (STT)
    • Uses Whisper to transcribe microphone input.
  • Audio Device Control
    • Choose and persist your preferred output device.
  • CLI with colors
    • Clean, color-coded output for user and GLaDOS lines.
  • Sarcasm detection
    • Optional helper to flag user sarcasm.

Command Line Usage

Once installed, you have access to the glados-cli command.

1. Select your audio output device

glados-cli audiosource
  • Lists all available audio devices.
  • Prompts you to choose one.
  • Saves your selection for future sessions in ~/.glados-cli.json.

2. Start a chat session

glados-cli start

Plain text chat (no TTS/STT).
Type exit or quit to leave.

3. Start with TTS

glados-cli start --tts

Replies are spoken in GLaDOS’s voice.

4. Start with Streaming

glados-cli start --stream

Replies print sentence-by-sentence as they’re generated.

5. Combine streaming + TTS

glados-cli start --stream --tts

Replies stream sentence-by-sentence and each is spoken aloud.

6. Override audio device (session only)

glados-cli start --tts --audiosource 27

Plays on device index 27 (from the device list).
Does not affect your saved config.

7. Enable Speech-to-Text

glados-cli start --stt

If integrated with a mic, transcriptions are fed into the chat.


Python Usage

Embed GLaDOS directly in your own scripts:

from glados_chat_lib import GladosChat

# Create a chat instance
chat = GladosChat(enable_tts=True, enable_stt=False, model="llama2:7b")

# One-shot conversation
reply = chat.ask("Do you hate humans?")
print("GLaDOS:", reply)
chat.speak(reply)

# Streaming mode
for piece in chat.ask("Tell me about science.", stream=True):
    print(piece, end="", flush=True)

Audio Devices

  • Run glados-cli audiosource to choose and persist your output.
  • To override without saving:
    glados-cli start --audiosource <index>
    
  • To reset to default, delete ~/.glados-cli.json.

Quick Examples

Hear GLaDOS out loud in two steps:

glados-cli audiosource
glados-cli start --stream --tts

Embed in Python (minimal TTS only):

from glados_chat_lib import GladosChat

chat = GladosChat(enable_tts=True)
print("GLaDOS:", chat.ask("Sing me a song about testing."))

Metadata

Release files for glados-chat-lib 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for glados-chat-lib 0.1
File Size Uploaded
glados_chat_lib-0.1.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for glados-chat-lib 0.1
File Interpreter ABI Platform
glados_chat_lib-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.6 kB

Release files / glados_chat_lib-0.1.tar.gz

Download URL glados_chat_lib-0.1.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
49fc98af3f8410151bbd6fa72c35104d4c1db795535c50b5be33e056dfaf16b1
BLAKE2b-256 checksum
How to use checksums
6b16c2dc19390955e9856de108772c44a6e3993a70f1bf6a5f159732ce25c557
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / glados_chat_lib-0.1-py3-none-any.whl

Download URL glados_chat_lib-0.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64bcb294769ddfc52f1198ea9c6af14d4a0911b9ec61672a0e5ad3d009d2ff55
BLAKE2b-256 checksum
How to use checksums
f6466eced0edb7c3c6768f5e7f185a276e1d425ca52a75caf4329f24705c57ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page