Create llm_provider.py
Browse files- llm_provider.py +18 -0
llm_provider.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from langchain_groq import ChatGroq
|
2 |
+
import os
|
3 |
+
|
4 |
+
api=os.getenv('groq_api')
|
5 |
+
|
6 |
+
def get_llm():
|
7 |
+
"""
|
8 |
+
Returns the language model instance (LLM) using ChatGroq API.
|
9 |
+
The LLM used is Llama 3.1 with a versatile 70 billion parameters model.
|
10 |
+
"""
|
11 |
+
return ChatGroq(
|
12 |
+
model="llama-3.3-70b-versatile",
|
13 |
+
temperature=0,
|
14 |
+
max_tokens=1024,
|
15 |
+
api_key=api
|
16 |
+
)
|
17 |
+
|
18 |
+
llm = get_llm()
|