modelsdev 0.11.4

A fast TUI and CLI for browsing AI models, benchmarks, and coding agents
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use anyhow::{Context, Result};

use crate::data::ProvidersMap;

const API_URL: &str = "https://models.dev/api.json";

pub fn fetch_providers() -> Result<ProvidersMap> {
    let response =
        reqwest::blocking::get(API_URL).context("Failed to fetch data from models.dev API")?;

    let providers: ProvidersMap = response.json().context("Failed to parse API response")?;

    Ok(providers)
}