An agent’s
model is a "provider/model" string. Omit it to use the default
openai/gpt-5.4-nano model with the inference credentials available at runtime.
Prerequisites
- At least one agent defined under
agents/(see Agents). - One configured inference path from the table above.
Veryfront Cloud AI Gateway
The AI Gateway provides managed model access without a model-vendor API key. Runveryfront login, then Push the project once to create its local project
link. veryfront dev and veryfront eval load the stored login and linked
project automatically.
Model selection follows these rules:
Use an explicit gateway model when the route must never switch to a direct
provider:
model: "auto", VERYFRONT_DEFAULT_MODEL can select another gateway
default. It is optional.
Runtime conventions (recommended)
For most projects, omitmodel entirely to use openai/gpt-5.4-nano. Set
model: "auto" only when you want runtime conventions to choose the backend:
useChat() also exposes inferenceMode so you can confirm
whether the response used cloud or server-local inference.
The runtime resolves model: "auto" from Cloud context or direct provider
credentials. VERYFRONT_DEFAULT_MODEL, VERYFRONT_DEFAULT_EMBEDDING_MODEL, and
VERYFRONT_RAG_BACKEND are optional overrides.
Direct providers
Set only the variables for the provider you use:OPENAI_API_KEYfor OpenAI.ANTHROPIC_API_KEYfor Anthropic.GOOGLE_API_KEYfor Google.MISTRAL_API_KEYfor direct Mistral requests. Without this key, hosted Mistral models route through Veryfront Cloud when cloud bootstrap is available.OPENAI_BASE_URLfor OpenAI-compatible services.
Enable OpenAI-hosted web search
Declareweb_search in the agent’s provider tools. Veryfront routes the call
through OpenAI’s Responses API, including for models that otherwise use Chat
Completions:
ext-llm-openai reference
for supported identifiers, arguments, and replay limits.
Embedded ONNX inference
Embedded inference is explicit. Use alocal/* model when you want the app
server process to run a curated ONNX model through @huggingface/transformers.
For local chat development, use Ollama or LM Studio unless you specifically
need the model to run inside the app process.
For Node.js or Bun, install the optional runtime alongside Veryfront. Deno
resolves the runtime on first use.
The selected model is downloaded and cached on first use. If the runtime cannot
load ONNX, the chat handler returns a
503 setup error. Veryfront never starts
an embedded model automatically.
Embedded ONNX inference uses CPU by default. To request WebGPU, use:
Model strings
Agents reference models as"provider/model". The framework splits on the first /, so nested model IDs work:
OpenAI-compatible services
Override the base URL to route through an OpenAI-compatible API. Public HTTPS services such as OpenRouter work without changing the host network policy:apiKey and baseURL are resolved per-request, so each project in a multi-tenant setup can have its own configuration.
For local chat development, use Ollama or LM Studio. Both keep model loading and
hardware management outside the Veryfront app process.
Local OpenAI-compatible servers need an explicit host-network opt-in. Veryfront
blocks loopback and private destinations by default to prevent server-side
request forgery. Set VERYFRONT_HOST_ALLOWED_INTERNAL_PROVIDER_ORIGINS to the
exact provider origins that Veryfront can reach. Include the scheme, host, and
port, but do not include /v1 or another path. Other internal destinations
remain blocked. Only the runtime operator can set this policy. A project
environment cannot grant itself access.
Ollama
Start Ollama and download a model. This example uses a model with tool-use support:openai provider:
OPENAI_API_KEY. See
Ollama OpenAI compatibility.
LM Studio
Load a model in LM Studio, start its local server on port 1234, then list the model IDs it exposes:/v1/models. For example:
OPENAI_API_KEY. See
LM Studio OpenAI compatibility.
Model behavior varies in both runtimes. Select a model with native tool-use
support when the agent uses tools.
Custom provider registration
For providers not covered by env vars, useregisterModelProvider():
doGenerate() and doStream().
Registration inside a project source context is isolated to that project.
Registration during application bootstrap, outside a project context, becomes
the default for every project unless a project registers an override. The
returned disposer removes only the registration created by that call.
Call unregisterOllama() during application teardown when the registration is
no longer needed.
Direct model resolution
For cases outside the agent system:Verify it worked
Call your agent’s AG-UI route once provider env vars are set:inferenceMode field on useChat reports
whether the call used cloud, server-local, or browser inference.