""" | |
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") | |
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) | |