Spaces:
Running
Running
File size: 541 Bytes
d8f6559 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import requests
import json
import os
url = "https://api.together.xyz/v1/models"
headers = {
"accept": "application/json",
"Authorization": f"Bearer {os.getenv('TOGETHER_API_KEY')}"
}
response = requests.get(url, headers=headers)
data = response.json()
keywords = ["OLMO"]
model_ids = []
for item in data:
if any(keyword.lower() in item["id"].lower() for keyword in keywords):
print(item["id"])
model_ids.append(item["id"])
with open("together_model_ids.json", "w") as f:
json.dump(model_ids, f, indent=4) |