Skip to content

Commit 1cee4df

Browse files
committed
chore(ai): revert to tool_calling and upgrade model to llama-3.3-70b-versatile
1 parent 95af238 commit 1cee4df

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎apps/python-service/routers/ai.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def query_builder(request: QueryBuilderRequest, req: Request):
8989
)
9090

9191
# Enforce structured output based on our Pydantic schema
92-
structured_llm = llm.with_structured_output(QueryResult, method="json_mode")
92+
structured_llm = llm.with_structured_output(QueryResult)
9393

9494
# Build the system prompt
9595
system_prompt = """You are a highly intelligent database query builder for a MongoDB-based BaaS called urBackend.
@@ -164,7 +164,7 @@ async def collection_creator(request: CollectionCreatorRequest, req: Request):
164164
encrypted_byok=request.encrypted_byok.model_dump() if request.encrypted_byok else None,
165165
)
166166

167-
structured_llm = llm.with_structured_output(CollectionCreatorResponse, method="json_mode")
167+
structured_llm = llm.with_structured_output(CollectionCreatorResponse)
168168

169169
system_prompt = """You are a MongoDB schema designer for urBackend, a Backend-as-a-Service platform.
170170

‎apps/python-service/services/byok.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ async def resolve_ai_client(
5656
logger.info("🔑 Attempting to decrypt BYOK Groq key for developer_id=%s...", developer_id)
5757
try:
5858
decrypted_key = decrypt_transit(encrypted_byok["groqKey"])
59-
logger.info("✅ BYOK Groq key decrypted successfully. Initializing ChatGroq client (model=llama-3.1-8b-instant)...")
59+
logger.info("✅ BYOK Groq key decrypted successfully. Initializing ChatGroq client (model=llama-3.3-70b-versatile)...")
6060
return ChatGroq(
6161
api_key=decrypted_key,
62-
model_name="llama-3.1-8b-instant",
62+
model_name="llama-3.3-70b-versatile",
6363
temperature=0,
6464
)
6565
except Exception as e:
@@ -107,10 +107,10 @@ async def resolve_ai_client(
107107
)
108108

109109
# ── 4. Return platform client ──
110-
logger.info("✅ Rate limit check passed for developer_id=%s. Initializing Platform ChatGroq client (model=llama-3.1-8b-instant)...", developer_id)
110+
logger.info("✅ Rate limit check passed for developer_id=%s. Initializing Platform ChatGroq client (model=llama-3.3-70b-versatile)...", developer_id)
111111
return ChatGroq(
112112
api_key=settings.GROQ_API_KEY,
113-
model_name="llama-3.1-8b-instant",
113+
model_name="llama-3.3-70b-versatile",
114114
temperature=0,
115115
)
116116

0 commit comments

Comments
 (0)