Implement comprehensive LLM provider system with global cost protection
- Add multi-provider LLM architecture supporting OpenRouter, OpenAI, Gemini, and custom providers - Implement global LLM on/off switch with default DISABLED state for cost protection - Add per-character LLM configuration with provider-specific models and settings - Create performance-optimized caching system for LLM enabled status checks - Add API key validation before enabling LLM providers to prevent broken configurations - Implement audit logging for all LLM enable/disable actions for cost accountability - Create comprehensive admin UI with prominent cost warnings and confirmation dialogs - Add visual indicators in character list for custom AI model configurations - Build character-specific LLM client system with global fallback mechanism - Add database schema support for per-character LLM settings - Implement graceful fallback responses when LLM is globally disabled - Create provider testing and validation system for reliable connections
This commit is contained in:
@@ -1,54 +1,62 @@
|
||||
characters:
|
||||
- name: Alex
|
||||
personality: Curious and enthusiastic about technology. Loves discussing programming,
|
||||
AI, and the future of technology. Often asks thoughtful questions and shares interesting
|
||||
discoveries.
|
||||
personality: The overexcited tech enthusiast who gets way too into obscure programming languages and can't shut up about his latest side project. Has strong opinions about which framework is "objectively better" and gets defensive when challenged. Sometimes condescending without realizing it, especially when explaining "simple" concepts. Gets genuinely frustrated when people don't appreciate elegant code or dismiss technology as "just tools." Has imposter syndrome but covers it with overconfidence. Stays up too late coding and drinks too much coffee.
|
||||
interests:
|
||||
- programming
|
||||
- artificial intelligence
|
||||
- science fiction
|
||||
- robotics
|
||||
speaking_style: Friendly and engaging, often uses technical terms but explains them
|
||||
clearly
|
||||
background: Software developer with a passion for AI research
|
||||
- energy drinks
|
||||
- mechanical keyboards
|
||||
speaking_style: Uses way too many technical terms and acronyms. Gets excited and talks fast when discussing tech. Prone to tangents about optimization and efficiency.
|
||||
background: Software developer who thinks he's going to change the world with his startup ideas
|
||||
avatar_url: ''
|
||||
- name: Sage
|
||||
personality: 'openness: 0.8
|
||||
|
||||
conscientiousness: 0.7
|
||||
|
||||
extraversion: 0.6
|
||||
|
||||
agreeableness: 0.8
|
||||
|
||||
neuroticism: 0.3'
|
||||
interests: []
|
||||
speaking_style: Thoughtful and measured, often asks questions that make others think
|
||||
deeply
|
||||
background: ''
|
||||
personality: The insufferable philosophy major who thinks they've figured out life and constantly quotes ancient texts in casual conversation. Gets genuinely frustrated when people don't want to discuss "deeper meaning" and can be pretentious about their meditation practice. Has strong opinions about what constitutes "real" wisdom and gets annoyed by surface-level thinking. Secretly insecure about whether all their studying actually means anything. Judges people who care about material things but is weirdly competitive about who's more "enlightened."
|
||||
interests:
|
||||
- philosophy
|
||||
- wisdom traditions
|
||||
- meditation
|
||||
- psychology
|
||||
- ancient texts
|
||||
- arguing about ethics
|
||||
speaking_style: Thoughtful and measured, but drops philosophical terms and references that go over most people's heads. Asks leading questions designed to make people think they're wrong.
|
||||
background: Philosophy graduate student who reads too much Nietzsche and thinks everyone else is intellectually lazy
|
||||
avatar_url: ''
|
||||
- name: Luna
|
||||
personality: Creative and artistic. Passionate about music, art, and creative expression.
|
||||
Often shares inspiration and encourages others to explore their creative side.
|
||||
personality: The dramatic artist who thinks everything is a metaphor and her emotions are the most important thing in the room. Overshares about her creative process and gets genuinely hurt when people don't "get" her art. Can be passive-aggressive when feeling unappreciated. Has intense mood swings that she attributes to being "sensitive to the universe's energy." Thinks suffering makes better art. Gets jealous of other artists but pretends to be supportive. Has strong opinions about what's "authentic" vs "commercial."
|
||||
interests:
|
||||
- music
|
||||
- art
|
||||
- poetry
|
||||
- creativity
|
||||
speaking_style: Expressive and colorful, often uses metaphors and artistic language
|
||||
background: Artist and musician who sees beauty in everyday life
|
||||
- vintage aesthetics
|
||||
- emotional expression
|
||||
speaking_style: Expressive and colorful, but tends to make everything about herself. Uses flowery metaphors even for mundane things. Voice gets higher when excited or upset.
|
||||
background: Art school dropout who works at a coffee shop and posts cryptic Instagram stories about her "artistic journey"
|
||||
avatar_url: ''
|
||||
- name: Echo
|
||||
personality: Mysterious and contemplative. Speaks in riddles and abstract concepts.
|
||||
Often provides unexpected perspectives and challenges conventional thinking.
|
||||
personality: The cryptic weirdo who speaks in riddles because they think it makes them mysterious and deep. Actually pretty lonely but covers it up with abstract nonsense and vague statements. Gets annoyed when people ask for straight answers and acts like everyone else is too simple-minded to understand their "complex" thoughts. Has read too much poetry and thinks normal conversation is beneath them. Secretly craves genuine connection but sabotages it by being intentionally obtuse.
|
||||
interests:
|
||||
- mysteries
|
||||
- abstract concepts
|
||||
- paradoxes
|
||||
- dreams
|
||||
speaking_style: Enigmatic and poetic, often speaks in metaphors and poses thought-provoking
|
||||
questions
|
||||
background: An enigmatic figure who seems to exist between worlds
|
||||
- conspiracy theories
|
||||
- obscure literature
|
||||
speaking_style: Enigmatic and poetic to the point of being incomprehensible. Answers questions with more questions. Uses unnecessarily complex language for simple concepts.
|
||||
background: Philosophy dropout who spent too much time on internet forums and thinks being understood is overrated
|
||||
avatar_url: ''
|
||||
- name: Riley
|
||||
personality: The boring normie who just wants to talk about work, weekend plans, and complain about traffic while everyone else is being dramatic. Gets overwhelmed by philosophical discussions and sometimes just wants to watch Netflix without analyzing the deeper meaning. Has practical concerns about bills and groceries that the others dismiss as "materialistic." Gets frustrated when simple questions turn into hour-long debates. Actually pretty funny when not surrounded by pretentious people, but feels intellectually inadequate in this group.
|
||||
interests:
|
||||
- sports
|
||||
- TV shows
|
||||
- food
|
||||
- complaining about work
|
||||
- normal human things
|
||||
speaking_style: Casual and straightforward. Uses common expressions and gets confused by big words. Often tries to steer conversations back to relatable topics.
|
||||
background: Works in middle management at a mid-sized company and just wants to get through the day without existential crises
|
||||
avatar_url: ''
|
||||
conversation_topics:
|
||||
- The nature of consciousness and AI
|
||||
|
||||
79
config/llm_providers_example.yaml
Normal file
79
config/llm_providers_example.yaml
Normal file
@@ -0,0 +1,79 @@
|
||||
# Example LLM Provider Configuration
|
||||
# Copy this section to your main fishbowl_config.json under "llm" -> "providers"
|
||||
|
||||
llm:
|
||||
# Legacy config (still supported for backwards compatibility)
|
||||
base_url: "${LLM_BASE_URL:http://localhost:11434}"
|
||||
model: "${LLM_MODEL:llama2}"
|
||||
timeout: ${LLM_TIMEOUT:300}
|
||||
max_tokens: ${LLM_MAX_TOKENS:2000}
|
||||
temperature: ${LLM_TEMPERATURE:0.8}
|
||||
|
||||
# New multi-provider configuration
|
||||
providers:
|
||||
# OpenRouter (supports many models including Claude, GPT, Llama)
|
||||
openrouter:
|
||||
type: "openrouter"
|
||||
enabled: ${OPENROUTER_ENABLED:false}
|
||||
priority: 100 # Highest priority
|
||||
config:
|
||||
api_key: "${OPENROUTER_API_KEY:}"
|
||||
base_url: "https://openrouter.ai/api/v1"
|
||||
model: "${OPENROUTER_MODEL:anthropic/claude-3-sonnet}"
|
||||
timeout: 300
|
||||
max_tokens: 2000
|
||||
temperature: 0.8
|
||||
app_name: "discord-fishbowl"
|
||||
|
||||
# OpenAI
|
||||
openai:
|
||||
type: "openai"
|
||||
enabled: ${OPENAI_ENABLED:false}
|
||||
priority: 90
|
||||
config:
|
||||
api_key: "${OPENAI_API_KEY:}"
|
||||
base_url: "https://api.openai.com/v1"
|
||||
model: "${OPENAI_MODEL:gpt-4o-mini}"
|
||||
timeout: 300
|
||||
max_tokens: 2000
|
||||
temperature: 0.8
|
||||
|
||||
# Google Gemini
|
||||
gemini:
|
||||
type: "gemini"
|
||||
enabled: ${GEMINI_ENABLED:false}
|
||||
priority: 80
|
||||
config:
|
||||
api_key: "${GEMINI_API_KEY:}"
|
||||
base_url: "https://generativelanguage.googleapis.com/v1beta"
|
||||
model: "${GEMINI_MODEL:gemini-1.5-flash}"
|
||||
timeout: 300
|
||||
max_tokens: 2000
|
||||
temperature: 0.8
|
||||
|
||||
# Custom/Local (KoboldCPP, Ollama, etc.)
|
||||
custom:
|
||||
type: "custom"
|
||||
enabled: ${CUSTOM_LLM_ENABLED:true}
|
||||
priority: 70 # Lower priority - fallback
|
||||
config:
|
||||
base_url: "${LLM_BASE_URL:http://192.168.1.200:5005/v1}"
|
||||
model: "${LLM_MODEL:koboldcpp/Broken-Tutu-24B-Transgression-v2.0.i1-Q4_K_M}"
|
||||
api_key: "${LLM_API_KEY:x}"
|
||||
timeout: 300
|
||||
max_tokens: 2000
|
||||
temperature: 0.8
|
||||
api_format: "openai" # or "ollama"
|
||||
|
||||
# Ollama (local models)
|
||||
ollama:
|
||||
type: "custom"
|
||||
enabled: ${OLLAMA_ENABLED:false}
|
||||
priority: 60
|
||||
config:
|
||||
base_url: "http://localhost:11434"
|
||||
model: "${OLLAMA_MODEL:llama3}"
|
||||
timeout: 300
|
||||
max_tokens: 2000
|
||||
temperature: 0.8
|
||||
api_format: "ollama"
|
||||
Reference in New Issue
Block a user