Skip to main content

list_models

Function list_models 

Source
pub async fn list_models(
    base_url: &str,
    api_key: Option<&str>,
    timeout: Duration,
) -> Result<Vec<String>>
Expand description

Which models an OpenAI-compatible server says it serves: GET {base_url}/models.

Written for eclipse setup, so it fails small and fast: the wizard wants “what can I pick from?” and treats any failure as “ask the user to type a name”. A server that answers with something other than the OpenAI shape yields an empty list rather than an error, because the endpoint exists but the answer is not usable either way.