chatRAG / get_models.py
Martechsol
Refine RAG pipeline for comprehensive leave retrieval, improve system prompt, and fix Gradio HTML rendering
392a1db
Raw
History Blame Contribute Delete
719 Bytes
import asyncio
import os
import httpx
from dotenv import load_dotenv
load_dotenv()
async def main():
api_key = os.getenv("GROQ_API_KEY")
if not api_key:
print("No API Key")
return
url = "https://api.groq.com/openai/v1/models"
headers = {"Authorization": f"Bearer {api_key}"}
async with httpx.AsyncClient() as client:
resp = await client.get(url, headers=headers)
if resp.status_code == 200:
models = resp.json().get("data", [])
for m in models:
if "deepseek" in m["id"].lower() or "qwen" in m["id"].lower():
print(m["id"])
else:
print(resp.status_code, resp.text)
asyncio.run(main())