File size: 512 Bytes
f016beb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
"""
Central place to load env vars and expose shared singletons.
"""
from functools import lru_cache
from pathlib import Path
from dotenv import load_dotenv
from langchain_groq import ChatGroq
# Load .env once when the module is imported
load_dotenv(dotenv_path=Path(__file__).resolve().parents[1] / ".env")
@lru_cache
def groq_llm(model: str = "llama3-70b-8192", temperature: float = 0.0):
"""Return a memoized Groq chat model instance."""
return ChatGroq(model_name=model, temperature=temperature)
|