Skip to Content
SdkReactHooksuseModels

useModels

useModels(options: object): UseModelsResult

Defined in: src/react/useModels.ts:42 

React hook for fetching available LLM models. Automatically fetches all available models.

Parameters

ParameterTypeDescription

options

object

options.autoFetch?

boolean

Whether to fetch models automatically on mount (default: true)

options.baseUrl?

string

Optional base URL for the API requests.

options.getToken?

() => Promise<string | null>

Custom function to get auth token for API calls

options.provider?

string

Optional filter for specific provider (e.g. “openai”)

Returns

UseModelsResult

Last updated on