Models
Pass a model ID when creating the agent. If you omit model, libfx uses its built-in default. Model requests in libfx 0.0.12 go through AI Gateway; use the key from Quick start.
Find a model
import { listModels } from 'libfx'
const models = await listModels({ apiKey: process.env.AI_GATEWAY_API_KEY })
console.log(models)
listModels() returns the available model IDs. Pass one as model in createFxAgent({ apiKey, model }).
To configure the model, group its ID and options together:
model: { id: 'your-model-id', effort: 'high', fast: true }
Choose a model that supports the requested effort and fast mode. A string model ID still works. Top-level effort and fast are deprecated and cannot be mixed with a model object.
Set reasoning effort
Set model.effort, such as effort: 'high' inside the model object. Available levels depend on the selected model. If the level is unsupported, creation fails with LIBFX_MODEL_UNSUPPORTED_EFFORT and lists the supported levels.
Omit model.effort or use 'default' to leave the choice to the model.
Enable fast mode
Set fast: true inside the model object for a model that supports a fast lane. Creation fails with LIBFX_MODEL_UNSUPPORTED_FAST if the selected model does not support it.
Change models
Save a checkpoint, then create a new agent with that checkpoint and the new model options. The checkpoint preserves the conversation; you supply these settings again.