Commit Graph

7 Commits

Author SHA1 Message Date
TPTBusiness 9ec02fcc11 Resolve merge conflicts with main: preserve llamacpp provider, env-based config, and main.py cleanup 2026-04-10 10:10:53 +02:00
CadeYu 8793336dad sync model validation with cli catalog 2026-03-25 21:23:02 +08:00
OpenClaw Assistant 3e509bfa32 feat: add llama.cpp local LLM support via .env configuration
Add 'llamacpp' as a new provider for running TradingAgents fully
offline with a local llama-server (llama.cpp).

Changes:
- factory.py: register 'llamacpp' provider alongside openai/ollama
- validators.py: accept any model name for llamacpp (like ollama)
- openai_client.py: llamacpp branch sets base_url from env/config,
  uses placeholder api_key so no auth error is raised
- default_config.py: load .env via python-dotenv (optional dep);
  LLM_PROVIDER, BACKEND_URL, DEEP_THINK_LLM, QUICK_THINK_LLM are
  all overridable via environment variables
- .env.example: document llamacpp setup alongside cloud providers
- .gitignore: ensure .env is ignored, .env.example is tracked

Fully backward-compatible: OpenAI remains the default when no
.env is present. Also works for LM Studio, vLLM, or any other
OpenAI-compatible local server via BACKEND_URL + LLM_PROVIDER=openai.

Tested with: llama.cpp llama-server + Qwen3.5-35B-A3B-Q3_K_M
2026-03-21 10:26:48 +01:00
Yijia-Xiao 551fd7f074 chore: update model lists, bump to v0.2.1, fix package build
- OpenAI: add GPT-5.4, GPT-5.4 Pro; remove o-series and legacy GPT-4o
- Anthropic: add Claude Opus 4.6, Sonnet 4.6; remove legacy 4.1/4.0/3.x
- Google: add Gemini 3.1 Pro, 3.1 Flash Lite; remove deprecated
  gemini-3-pro-preview and Gemini 2.0 series
- xAI: clean up model list to match current API
- Simplify UnifiedChatOpenAI GPT-5 temperature handling
- Add missing tradingagents/__init__.py (fixes pip install building)
2026-03-15 23:34:50 +00:00
Yijia Xiao 54cdb146d0
feat: add footer statistics tracking with LangChain callbacks
- Add StatsCallbackHandler for tracking LLM calls, tool calls, and tokens
- Integrate callbacks into TradingAgentsGraph and all LLM clients
- Dynamic agent/report counts based on selected analysts
- Fix report completion counting (tied to agent completion)
2026-02-03 22:27:20 +00:00
Yijia Xiao d4dadb82fc
feat: add multi-provider LLM support with thinking configurations
Models added:
- OpenAI: GPT-5.2, GPT-5.1, GPT-5, GPT-5 Mini, GPT-5 Nano, GPT-4.1
- Anthropic: Claude Opus 4.5/4.1, Claude Sonnet 4.5/4, Claude Haiku 4.5
- Google: Gemini 3 Pro/Flash, Gemini 2.5 Flash/Flash Lite
- xAI: Grok 4, Grok 4.1 Fast (Reasoning/Non-Reasoning)

Configs updated:
- Add unified thinking_level for Gemini (maps to thinking_level for Gemini 3,
  thinking_budget for Gemini 2.5; handles Pro's lack of "minimal" support)
- Add OpenAI reasoning_effort configuration
- Add NormalizedChatGoogleGenerativeAI for consistent response handling

Fixes:
- Fix Bull/Bear researcher display truncation
- Replace ChromaDB with BM25 for memory retrieval
2026-02-03 22:27:20 +00:00
Yijia Xiao 79051580b8
feat: add multi-provider LLM support with factory pattern
- Add tradingagents/llm_clients/ with unified factory pattern
- Support OpenAI, Anthropic, Google, xAI, OpenRouter, Ollama, vLLM
- Replace direct LLM imports in trading_graph.py with create_llm_client()
- Handle provider-specific params (reasoning_effort, thinking_config)
2026-02-03 22:27:20 +00:00