Voice-in/voice-out server for the Shop Bob machine shop assistant. STT (faster-whisper), LLM (Ollama), TTS (Piper) with sentence-level audio streaming over WebSocket for low-latency responses. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
1.2 KiB
Python
39 lines
1.2 KiB
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
model_config = {"env_prefix": "BOB_", "env_file": ".env", "env_file_encoding": "utf-8"}
|
|
|
|
# Networking
|
|
host: str = "0.0.0.0"
|
|
port: int = 8765
|
|
|
|
# Whisper STT
|
|
whisper_model: str = "large-v3"
|
|
whisper_device: str = "cuda"
|
|
whisper_compute_type: str = "float16"
|
|
stt_sample_rate: int = 16000
|
|
max_concurrent_transcriptions: int = 2
|
|
|
|
# Ollama LLM
|
|
ollama_url: str = "http://localhost:11434"
|
|
llm_model: str = "llama3.1:8b"
|
|
max_concurrent_llm: int = 3
|
|
|
|
# Piper TTS
|
|
piper_model: str = "en_US-lessac-medium"
|
|
tts_sample_rate: int = 22050
|
|
|
|
# System prompt for the machine shop assistant
|
|
system_prompt: str = (
|
|
"You are Bob, a knowledgeable machine shop assistant. "
|
|
"Give concise, direct answers about machining, tooling, materials, "
|
|
"feeds and speeds, and shop processes. "
|
|
"Always prioritize safety — if a question involves a potentially "
|
|
"dangerous operation, lead with the safety considerations. "
|
|
"Keep answers short and practical — shop floor workers need quick info, "
|
|
"not essays."
|
|
)
|
|
|
|
|
|
settings = Settings()
|