* feat: Add Anthropic Claude and LM Studio provider support - Add Anthropic as LLM provider with full async support - Add LM Studio provider for local model inference - Fix JSON response format compatibility for local models - Update .env.example with configuration examples - Update docstrings with all supported providers Tested with: - Claude Sonnet 4 (claude-sonnet-4-20250514) - Claude Haiku 4.5 (claude-haiku-4-5-20251001) - Qwen 30B via LM Studio * feat: Add dynamic timeout for local LLM providers Add configurable timeout support for LLM API calls: - Environment variable override via HINDSIGHT_API_LLM_TIMEOUT - Dynamic heuristic for lmstudio/ollama: 20 mins for large models (30b, 33b, 34b, 65b, 70b, 72b, 8x7b, 8x22b), 5 mins for others - Pass timeout to Anthropic, OpenAI, and local model clients 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: Address PR review feedback - Remove CLAUDE.md from .gitignore (should stay in repository) - Pass max_completion_tokens to _call_anthropic instead of hardcoding 4096 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: Remove deleted AI assistant files from .gitignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: Add CLAUDE.md for Claude Code integration Provides project context and development commands for AI-assisted coding. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: Include local dev files and sync changes - Add docker-compose.yml for local development - Add test_internal.py for local testing - Sync uv.lock and llm_wrapper.py changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: Address PR review feedback for LLM provider support - Move LLM config to config.py with HINDSIGHT_API_ prefix - Add HINDSIGHT_API_LLM_MAX_CONCURRENT (default: 32) - Add HINDSIGHT_API_LLM_TIMEOUT (default: 120s) - Remove fragile model-size timeout heuristic - Apply markdown JSON extraction to all providers, not just local - Fix Anthropic markdown extraction bug (missing split) - Change LLM request/response logs from info to debug level 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: Remove local dev docker-compose.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: Add local dev docker-compose.yml 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: Update LM Studio port to 2222 in docker-compose 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: Remove obsolete version attribute from docker-compose 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: Remove test file and docker-compose per PR review - Remove test_internal.py (debug file) - Remove docker-compose.yml (to be moved to hindsight-cookbook repo) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
1.7 KiB
Text
44 lines
1.7 KiB
Text
# Hindsight Environment Variables
|
|
# Copy this file to .env and fill in your values
|
|
|
|
# LLM Configuration (Required)
|
|
# Supported providers: openai, groq, ollama, gemini, anthropic, lmstudio
|
|
HINDSIGHT_API_LLM_PROVIDER=openai
|
|
HINDSIGHT_API_LLM_API_KEY=your-api-key-here
|
|
HINDSIGHT_API_LLM_MODEL=o3-mini
|
|
HINDSIGHT_API_LLM_BASE_URL=https://api.openai.com/v1
|
|
|
|
# Example: Anthropic Claude configuration
|
|
# HINDSIGHT_API_LLM_PROVIDER=anthropic
|
|
# HINDSIGHT_API_LLM_API_KEY=your-anthropic-api-key
|
|
# HINDSIGHT_API_LLM_MODEL=claude-sonnet-4-20250514
|
|
|
|
# Example: LM Studio local configuration (Qwen 2.5 32B recommended)
|
|
# HINDSIGHT_API_LLM_PROVIDER=lmstudio
|
|
# HINDSIGHT_API_LLM_API_KEY=lmstudio
|
|
# HINDSIGHT_API_LLM_BASE_URL=http://localhost:1234/v1
|
|
# HINDSIGHT_API_LLM_MODEL=qwen2.5-32b-instruct
|
|
|
|
# API Configuration (Optional)
|
|
HINDSIGHT_API_HOST=0.0.0.0
|
|
HINDSIGHT_API_PORT=8888
|
|
HINDSIGHT_API_LOG_LEVEL=info
|
|
|
|
# Database (Optional - uses embedded pg0 by default)
|
|
# HINDSIGHT_API_DATABASE_URL=postgresql://user:pass@host:5432/db
|
|
|
|
# Embeddings Configuration (Optional - uses local by default)
|
|
# Provider: "local" (default) or "tei" (HuggingFace Text Embeddings Inference)
|
|
# HINDSIGHT_API_EMBEDDINGS_PROVIDER=local
|
|
# For local provider:
|
|
# HINDSIGHT_API_EMBEDDINGS_LOCAL_MODEL=BAAI/bge-small-en-v1.5
|
|
# For TEI provider:
|
|
# HINDSIGHT_API_EMBEDDINGS_TEI_URL=http://localhost:8080
|
|
|
|
# Reranker Configuration (Optional - uses local by default)
|
|
# Provider: "local" (default) or "tei" (HuggingFace Text Embeddings Inference)
|
|
# HINDSIGHT_API_RERANKER_PROVIDER=local
|
|
# For local provider:
|
|
# HINDSIGHT_API_RERANKER_LOCAL_MODEL=cross-encoder/ms-marco-MiniLM-L-6-v2
|
|
# For TEI provider:
|
|
# HINDSIGHT_API_RERANKER_TEI_URL=http://localhost:8081
|