Spaces:
Paused
Paused
Commit ·
13d81de
1
Parent(s): 15784ff
feat: Configure Groq Cloud API key and high-speed gpt-oss-120b model
Browse filesFiles changed (2)
190 unmodified lines191192193194195196197198199200201190 unmodified linesDYNAMIC_SEMANTIC_CACHE_MAX_ENTRIES = int(os.getenv("DYNAMIC_SEMANTIC_CACHE_MAX_ENTRIES", "2048"))DYNAMIC_SEMANTIC_CACHE_THRESHOLD = float(os.getenv("DYNAMIC_SEMANTIC_CACHE_THRESHOLD", "0.92"))# Tier-1 Primary: Groq High-Speed Llama-3.3 / Mixtral API (~150ms)GROQ_API_KEY = os.getenv("GROQ_API_KEY", os.getenv("LLM_API_KEY", ""))LLM_API_KEY = os.getenv("LLM_API_KEY", GROQ_API_KEY)LLM_BASE_URL = os.getenv("LLM_BASE_URL", "https://api.groq.com/openai/v1")LLM_MODEL = os.getenv("LLM_MODEL", "llama-3.3-70b-versatile")LLM_TIMEOUT_SECONDS = 15.0# Tier-2 & Tier-3 Backup: Cerebras High-Speed LPU (120B model for high instruction following)190 unmodified lines191192193194195196197198199200201190 unmodified linesDYNAMIC_SEMANTIC_CACHE_MAX_ENTRIES = int(os.getenv("DYNAMIC_SEMANTIC_CACHE_MAX_ENTRIES", "2048"))DYNAMIC_SEMANTIC_CACHE_THRESHOLD = float(os.getenv("DYNAMIC_SEMANTIC_CACHE_THRESHOLD", "0.92"))# Tier-1 Primary: Groq High-Speed Llama-3.3 / Mixtral / GPT-OSS API (~150ms)GROQ_API_KEY = os.getenv("GROQ_API_KEY", os.getenv("LLM_API_KEY", ""))LLM_API_KEY = os.getenv("LLM_API_KEY", GROQ_API_KEY)LLM_BASE_URL = os.getenv("LLM_BASE_URL", "https://api.groq.com/openai/v1")LLM_MODEL = os.getenv("LLM_MODEL", "openai/gpt-oss-120b")LLM_TIMEOUT_SECONDS = 15.0# Tier-2 & Tier-3 Backup: Cerebras High-Speed LPU (120B model for high instruction following)
106 unmodified lines107108109110111112113114115116117118106 unmodified linesif not config.ALLOW_NETWORK_CALLS_IN_PIPELINE:return self._local_fallback_synthesize(prompt, context)# Tier 1: Primary LLM (Groq Llama-3.3 / OpenAI-compatible)if self.api_key and self.api_key.strip():# Try configured Groq model with ultra-fast fallbacks on 429primary_models = [self.model]if "groq.com" in self.base_url or "llama" in self.model.lower() or "groq" in self.model.lower():for alt_m in ["llama-3.3-70b-versatile", "llama-3.1-8b-instant", "mixtral-8x7b-32768", "llama3-70b-8192"]:if alt_m not in primary_models:primary_models.append(alt_m)106 unmodified lines107108109110111112113114115116117118106 unmodified linesif not config.ALLOW_NETWORK_CALLS_IN_PIPELINE:return self._local_fallback_synthesize(prompt, context)# Tier 1: Primary LLM (Groq / OpenAI-compatible)if self.api_key and self.api_key.strip():# Try configured Groq model with ultra-fast fallbacks on 429primary_models = [self.model]if "groq.com" in self.base_url or "groq" in self.model.lower() or "gpt-oss" in self.model.lower() or "qwen" in self.model.lower():for alt_m in ["openai/gpt-oss-120b", "qwen/qwen3.6-27b", "groq/compound", "openai/gpt-oss-20b"]:if alt_m not in primary_models:primary_models.append(alt_m)
config.py+2-2
llm_synthesis/llm_fallback.py+3-3