MCPcopy
hub / github.com/cheahjs/free-llm-api-resources / fetch_hyperbolic_models

Function fetch_hyperbolic_models

src/pull_available_models.py:314–341  ·  view source on GitHub ↗
(logger)

Source from the content-addressed store, hash-verified

312
313
314def fetch_hyperbolic_models(logger):
315 logger.info("Fetching Hyperbolic models from API...")
316 r = requests.get(
317 "https://api.hyperbolic.xyz/v1/models",
318 headers={
319 "accept": "application/json",
320 "authorization": f"Bearer {os.environ['HYPERBOLIC_API_KEY']}",
321 },
322 )
323 r.raise_for_status()
324 models = r.json()["data"]
325 logger.info(f"Fetched {len(models)} models from Hyperbolic's API")
326 ret_models = []
327 for model in models:
328 if model["id"] in HYPERBOLIC_IGNORED_MODELS:
329 logger.debug(f"Ignoring model {model['id']}")
330 continue
331 ret_models.append(
332 {
333 "id": model["id"],
334 "name": get_model_name(model["id"]),
335 "limits": {
336 "requests/minute": 60,
337 },
338 }
339 )
340 logger.debug(json.dumps(ret_models, indent=4))
341 return sorted(ret_models, key=lambda x: x["name"])
342
343
344def fetch_github_models(logger):

Callers 1

mainFunction · 0.85

Calls 1

get_model_nameFunction · 0.85

Tested by

no test coverage detected