Commit ·
abd9bdb
1
Parent(s): 86a7fd1
Default to Gemini 2.5-flash (thinking disabled) for text/judge nodes
Browse filesKey fixed on a non-billing project; 2.5-flash with thinking_budget=0 is fast and accurate (Mercedes Sosa -> correct '3'). Pace lowered to 0.15 rps for the ~10 RPM free tier.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Files changed (3)
3 unmodified lines4567891011121314151617183 unmodified lines# Required when LLM_PROVIDER=gemini (default). Free key: aistudio.google.comGOOGLE_API_KEY=# --- LLM provider for text/reasoning + judge nodes: "groq" or "gemini" ---# Default "groq" + llama-3.1-8b-instant works with the existing key (high TPM).# Switch to "gemini" for better quality once you have a free-tier GOOGLE_API_KEY# (created in a Google project WITHOUT billing enabled, else free tier = 0).LLM_PROVIDER=groqGROQ_TEXT_MODEL=llama-3.1-8b-instantGEMINI_TEXT_MODEL=gemini-2.0-flash# Global pace across all text-LLM calls (req/sec). 0.2 = ~12/min.RATE_LIMIT_RPS=0.2# --- Optional: LangSmith tracing (nice for debugging the graph) ---# Set TRACING=true and provide the API key to stream runs to smith.langchain.com.3 unmodified lines45678910111213141516173 unmodified lines# Required when LLM_PROVIDER=gemini (default). Free key: aistudio.google.comGOOGLE_API_KEY=# --- LLM provider for text/reasoning + judge nodes: "gemini" or "groq" ---# Default "gemini" + gemini-2.5-flash (best quality, high free-tier TPM).# GOOGLE_API_KEY must come from a project WITHOUT billing (else free tier = 0).LLM_PROVIDER=geminiGEMINI_TEXT_MODEL=gemini-2.5-flashGROQ_TEXT_MODEL=llama-3.1-8b-instant# Global pace across all text-LLM calls (req/sec). 0.15 = ~9/min (<10 RPM free).RATE_LIMIT_RPS=0.15# --- Optional: LangSmith tracing (nice for debugging the graph) ---# Set TRACING=true and provide the API key to stream runs to smith.langchain.com.
23 unmodified lines24252627282930313233343536373839404142434423 unmodified linesgoogle_api_key: str = ""# --- LLM provider for the text/reasoning + judge nodes ---# "groq" (default, works with the existing key) or "gemini" (better quality,# needs a free-tier GOOGLE_API_KEY from a project WITHOUT billing enabled).# Vision + Whisper always use Groq.llm_provider: str = "groq"# --- Models (override via env) ---gemini_text_model: str = "gemini-2.0-flash"# 8b-instant has ~30k TPM free (vs 70B's ~12k) so it survives the batch.groq_text_model: str = "llama-3.1-8b-instant"groq_vision_model: str = "meta-llama/llama-4-scout-17b-16e-instruct"groq_whisper_model: str = "whisper-large-v3"# --- Rate limiting (requests/sec across all text-LLM calls) ---# Gemini 2.0-flash free tier ~15 RPM; 0.2 rps = ~12/min keeps headroom.rate_limit_rps: float = 0.2# --- API + control knobs ---gaia_api_url: str = "https://agents-course-unit4-scoring.hf.space"23 unmodified lines2425262728293031323334353637383940414223 unmodified linesgoogle_api_key: str = ""# --- LLM provider for the text/reasoning + judge nodes ---# "gemini" (default, best quality + high free-tier TPM) or "groq".# Vision + Whisper always use Groq.llm_provider: str = "gemini"# --- Models (override via env) ---gemini_text_model: str = "gemini-2.5-flash"groq_text_model: str = "llama-3.1-8b-instant"groq_vision_model: str = "meta-llama/llama-4-scout-17b-16e-instruct"groq_whisper_model: str = "whisper-large-v3"# --- Rate limiting (requests/sec across all text-LLM calls) ---# Gemini 2.5-flash free tier ~10 RPM; 0.15 rps = ~9/min keeps headroom.rate_limit_rps: float = 0.15# --- API + control knobs ---gaia_api_url: str = "https://agents-course-unit4-scoring.hf.space"
44 unmodified lines45464748495051525354555644 unmodified lines# Default: Gemini (high free-tier TPM).from langchain_google_genai import ChatGoogleGenerativeAIreturn ChatGoogleGenerativeAI(model=s.gemini_text_model,google_api_key=s.google_api_key,temperature=temperature,max_retries=3,rate_limiter=limiter,)44 unmodified lines45464748495051525354555657585944 unmodified lines# Default: Gemini (high free-tier TPM).from langchain_google_genai import ChatGoogleGenerativeAI# thinking_budget=0 disables 2.5-flash's reasoning tokens -> much faster and# cheaper, which matters under the slow free-tier RPM pacing.return ChatGoogleGenerativeAI(model=s.gemini_text_model,google_api_key=s.google_api_key,temperature=temperature,max_retries=3,rate_limiter=limiter,thinking_budget=0,)
.env.example+7-8
gaia_agent/config.py+5-7
gaia_agent/llm.py+3