Waifu Companion supports multiple LLM providers for AI chat, translation, and summarization. Providers are tried in priority order.
Both Groq and OpenRouter support streaming responses for real-time text feedback.
Groq provides ultra-fast inference powered by LPU hardware. Default model: llama-3.3-70b-versatile.
gsk_)| Setting | Description |
|---|---|
| Use Groq | Enable/disable Groq as the active provider |
| API Key | Your Groq API key from console.groq.com |
| Model Name | The model to use (e.g., llama-3.3-70b-versatile, mixtral-8x7b-32768) |
Groq offers free API access with rate limits. Check console.groq.com for current limits and available models.
Groq supports response_format: { type: 'json_object' } for structured responses. This is used automatically for chat responses.
OpenRouter provides access to a wide variety of LLM models from different providers through a single API.
sk-or-v1-)| Setting | Description |
|---|---|
| API Key | Your OpenRouter API key from openrouter.ai |
| Primary Model | Main model (e.g., stepfun/step-3.5-flash:free) |
| Fallback Model 1 | Used if primary fails |
| Fallback Model 2 | Used if both primary and fallback 1 fail |
Some models on OpenRouter don't support JSON response format. These are automatically detected and excluded:
stepfun/step-3.5-flash:freestepfun/step-1-flashWhen no LLM provider is configured or all providers fail, a built-in heuristic engine provides pattern-matching responses.
isFallback: trueThe AI system constructs a structured prompt containing:
The AI responds with a JSON object containing:
{
"reply": "The character's response text",
"emotion": "happy",
"gesture": "head_tilt"
}
Emotions (happy, sad, surprised, neutral, thoughtful, excited) trigger Live2D model expressions and animations.
Provider modules follow a consistent interface:
const NewProviderAPI = {
isConfigured() { /* returns boolean */ },
async createCompletion({ messages, json }) {
/* returns { content: string } */
},
async createCompletionStream({ messages, json }) {
/* returns { stream: ReadableStream, response: Response } */
}
};
window.NewProviderAPI = NewProviderAPI;