ExLLM.ModelLoader (ex_llm v0.5.0)

View Source

Dynamic model loader for ExLLM adapters.

Provides functionality to:

  1. Fetch models from provider APIs where available
  2. Fall back to YAML configuration files
  3. Cache results to avoid repeated API calls

Summary

Functions

Clears the model cache for a specific provider or all providers.

Loads models for a provider, attempting API first then falling back to config.

Functions

clear_cache(provider \\ :all)

Clears the model cache for a specific provider or all providers.

load_models(provider, options \\ [])

Loads models for a provider, attempting API first then falling back to config.

Options

  • :force_refresh - Skip cache and fetch fresh data
  • :api_fetcher - Function to fetch from API: fn(options) -> {:ok, models} | {:error, reason}

  • :config_transformer - Function to transform config data to Types.Model structs