parthib07's picture
Upload 52 files
61411b5 verified
raw
history blame contribute delete
438 Bytes
from __future__ import annotations
import os
from functools import lru_cache
from langchain_groq import ChatGroq
@lru_cache(maxsize=1)
def get_groq_llm(model: str = "llama-3.3-70b-versatile", temperature: float = 0.0) -> ChatGroq:
api_key = os.getenv("GROQ_API_KEY", "")
if not api_key:
raise ValueError("Missing GROQ_API_KEY.")
return ChatGroq(model=model, temperature=temperature, api_key=api_key)