feat: Ollama adapter + chat rate limiter (30 req/hour)
Ollama adapter (internal/chat/ollama.go): - Implements model.LLM interface for ADK Go - Talks to Ollama's OpenAI-compatible API (/v1/chat/completions) - Full tool/function calling support (tested with Mistral Small 3.2) - Converts ADK types to OpenAI format (messages, tools, tool_calls) - Configurable via OLLAMA_HOST and OLLAMA_MODEL env vars Multi-provider handler: - MODEL_PROVIDER env: "gemini" (default) or "ollama" - Gemini: requires GOOGLE_API_KEY (pay-as-you-go recommended) - Ollama: connects to local or Tailscale-remote instance Rate limiter: - 30 requests/hour per IP on /api/chat endpoint - Uses existing middleware.NewRateLimiter pattern Tested: Ollama + Mistral Small 3.2 on M4 Pro 64GB — correct answers
This commit is contained in:
@@ -80,6 +80,19 @@ SMTP_PASSWORD=your-password
|
||||
SMTP_FROM_EMAIL=your-email@yourdomain.com
|
||||
CONTACT_EMAIL=recipient@example.com
|
||||
|
||||
# Chat AI Configuration
|
||||
#
|
||||
# MODEL_PROVIDER: "gemini" (default) or "ollama"
|
||||
# MODEL_PROVIDER=gemini
|
||||
#
|
||||
# Gemini settings (when MODEL_PROVIDER=gemini):
|
||||
# GOOGLE_API_KEY=your-google-api-key
|
||||
# MODEL_NAME=gemini-2.5-flash
|
||||
#
|
||||
# Ollama settings (when MODEL_PROVIDER=ollama):
|
||||
# OLLAMA_HOST=http://localhost:11434
|
||||
# OLLAMA_MODEL=mistral-small3.2
|
||||
|
||||
# Production Settings
|
||||
# Uncomment for production:
|
||||
# GO_ENV=production
|
||||
|
||||
Reference in New Issue
Block a user