3.7.0
BoxLang AI Module 3.7.0 (unreleased). Named configuration profiles, embeddings defaults, and a Mistral speech fix.
Released: November 3, 2026
BoxLang AI 3.7.0 adds profiles: name a combination of provider, model, params, options and API key once (fast, planner), then pick it by name for a call, for an agent, or for a single agent run. It gives chat UIs what they need to list profiles and switch between them, without ever returning an API key.
It also gives aiEmbed() its own default provider and model, so embeddings no longer depend on your chat provider, and it fixes Mistral text-to-speech rejecting a voice name.
This page is updated as new items land on
development.
⚠️ Migration
MCP servers no longer trust forwarded headers by default.
X-Forwarded-Forand similar headers were read from anyone, so a client could pick its own IP. Now the client IP is the connection address unless you set your proxies withwithTrustedProxies( [ "10.0.0.0/8" ] )ormcp.server.trustedProxies.[ "*" ]restores the old behavior. A server behind a proxy that useswithAllowedIPs()must set its trusted proxies. See Trusted Proxies.Without a
profilessetting nothing else changes.
✨ New Features
🧩 Profiles
A profile is a named combination of provider, model, params, options and API key. Set them in boxlang.json:
"profiles": {
"fast": {
"description": "Cheap and quick, for small tasks",
"provider": "openai",
"model": "gpt-4.1-mini",
"params": { "temperature": 0 },
"apiKeyEnv": "OPENAI_API_KEY"
},
"planner": {
"description": "Slower and smarter, for planning",
"provider": "claude",
"model": "claude-opus-5-5",
"params": { "max_tokens": 8192 },
"apiKeyEnv": "CLAUDE_API_KEY"
}
},
"defaultProfile": ""Then pick one:
aiChat(), aiChatStream(), aiEmbed()
options: { profile: "fast" }
aiService(), aiModel(), aiAgent()
profile: "fast"
One agent run
agent.run( input, params, { profile: "planner" } ), also stream()
An agent, for good
agent.withProfile( "planner" ), then agent.getProfile()
Params layer as
defaultParams, thenproviders.<name>.params, then the profile, then the params of the call. An explicit provider, key, param or option in the call always wins.
The profile
defaultalways exists. It is your top levelprovider,apiKeyanddefaultParams.defaultProfilenames another profile to use when a call names no provider.Changing an agent's profile replaces its model. Memory, tools, sub-agents, instructions, the agent's own params and options, and the middleware, skills and MCP servers of the model stay.
setModel()sets the agent's profile to the one of its new model.A profile's params (including its model) and options only reach its own provider, like its key.
A sub-agent has its own profile, set when you create it with
aiAgent( profile: ). A profile passed to a run applies to that agent only.The module checks the settings when it starts: a profile cannot be named like a provider or
default, names use letters, numbers,_and-, anddefaultProfilemust exist (InvalidConfiguration). An unknown profile in a call throwsProfileNotFound.
Listing profiles
For chat UIs and remote control (a /profile or /provider command):
aiProfiles()
Every profile, the default first: name, description, provider, model, params, options, apiKeyEnv, hasApiKey, isDefault
aiProfile( name )
One of those
aiProviders()
name, isDefault, hasApiKey for each provider
Nothing returns an API key. Params and options that look like secrets show as ****. A new onAIProfileSwitch event fires with { agent, from, to, scope } when an agent changes profile.
Keys stay secret
Prefer
apiKeyEnv, the name of the environment variable, to a literalapiKey.A profile key is only sent to the profile's own provider. The global
apiKeyis no longer sent to a different provider when a profile selects one.profilesis removed from request options, so it cannot reach logs or events.
🔢 Embeddings Defaults
aiEmbed() used your chat provider, which fails when that provider has no embeddings. The new embeddings setting gives it its own default:
The order of priority is the call, then options.profile, then the embeddings setting, then defaultProfile (its provider, key and options only), then the default provider. The global apiKey still applies when the embeddings provider is the global provider. Empty values keep the old behavior.
🚦 MCP Server Rate Limiting
Limit how often one client can call an MCP server you build with mcpServer():
One sliding window counter, checked before authentication. A CORS preflight is not counted.
keyis"ip"(default),"apiKey"(only keys your provider accepts, and a new key is counted on the IP before your provider is asked, so a flood of fake keys never reaches it),"global", or a lambda. Keys are hashed in stores.Blocked requests get
429, JSON-RPC-32002,Retry-AfterandX-RateLimit-*headers. A store failure lets requests through, or answers503withfailOpen: false.Counters live in a BoxLang cache by default, or
"memory", or your ownIRateLimitStore.Nothing is logged on the request path, so a flood cannot fill your logs. The new
onMCPRateLimitHitevent fires at most 10 times a minute per server. Stats havesecurity.rateLimitFailuresand arateLimitsection with exact totals.withTrustedProxies()and themcp.server.trustedProxiessetting: forwarded headers are only honored from your proxies. Empty (the default) never trusts them,[ "*" ]trusts them from anyone (see Migration).New
mcp.server.rateLimitsettings give defaults for every server. Off by default.Several limits per server (
limits: [ { limit: 60, window: 60 }, { limit: 1000, window: 3600 } ]),disableRateLimit()andenableRateLimit(),resetRateLimit()andresetRateLimitStats().History and reports: per client and day, kept in the cache for
retentionDays(default 7).getRateLimitReport( { days, top } )returns the days and the top consumers withpeakPerMinuteandpctOfLimit. SettingshistoryFlushSeconds(30) andhistoryMaxClients(500) bound the cost.
See Rate Limiting.
🪲 Fixed
OpenAI images:
gpt-image-1was shut down by OpenAI on 2026-10-23, soaiImage()with OpenAI failed withThe model 'gpt-image-1' does not exist. The default is nowgpt-image-2.5-flare. Usemodel: "gpt-image-2.5-sunburst"for OpenAI's most capable image model. See Generating Images.Cache timeouts: BoxLang cache timeouts are in seconds, but the HITL
CacheDecisionStoreandCacheMemory.saveState()passed minutes, so grants and checkpoints expired 60 times too early.MCP client IPs: a port was never removed from
192.168.1.1:8080and the IPv6 address::1became1. Bracketed IPv6 ([::1]:8080) works too.Mistral text-to-speech failed with
voice is not supported for speech v1(HTTP 400, code 3051) when a voice name (or the voice of another provider, such as OpenAI'snova) reached it. Mistral only hasvoice_id, sovoiceis translated: a UUID is sent asvoice_id, the name of one of your Mistral voices is looked up in your Mistral voices and its id is sent, and a name with no match falls back to the first preset voice. The default model is now Voxtral TTS 3 (voxtral-mini-tts-3-0), sincevoxtral-mini-tts-2603is deprecated and retires on 2027-04-30.
🧰 Project
MockServicerecords the other params of each request (temperature,max_tokens, ...) ingetRecorded()asparams, so tests can check what reached the provider.The live MiniMax tests only run with
AI_TESTS_MINIMAX=true.The
Releaseworkflow can be run by hand fromdevelopmentormainwith asnapshotinput. It never runs the tests.
📖 Documentation
Rate Limiting, new, and trusted proxies in Server Configuration
Profiles, new
Configuration, new, and a shorter Installation
aiProfile, aiProfiles and aiProviders, new
The
bx-ai-profilesskill in ortus-boxlang/skills covers profiles for AI coding agents
Last updated