2.1.0
BoxLang AI Module v2.1.0 Release Notes - Multi-Tenant Tracking, OpenSearch Vector Memory, Bedrock Streaming, and Provider Configuration
This release focuses on enterprise features including multi-tenant usage tracking, OpenSearch vector memory support, AWS Bedrock streaming, and enhanced provider configuration capabilities.
π Major Features
Multi-Tenant Usage Tracking
Provider-agnostic request tagging for per-tenant billing and usage tracking.
Track Usage by Tenant:
// Tag requests with tenant information
result = aiChat(
messages: "Generate report",
options: {
tenantId: "customer-123",
usageMetadata: {
costCenter: "marketing",
projectId: "campaign-2024",
userId: "user@example.com"
}
}
)
// Works with all providers: OpenAI, Bedrock, Ollama, DeepSeek, etc.Intercept Token Usage Events:
Predefined Provider Configuration
Define multiple providers with default parameters in module configuration.
Module Configuration:
Using Predefined Providers:
Provider-Specific Options
Generic providerOptions struct for provider-specific configuration.
AWS Bedrock Inference Profiles:
Access Provider Options in Custom Services:
OpenSearch Vector Memory Provider
Full integration with OpenSearch k-NN for semantic search and RAG applications.
Create OpenSearch Memory:
Multi-Tenant Isolation:
OpenAI-Compatible Embedding Support
Use custom OpenAI-compatible embedding services with vector memory providers.
Custom Embedding Endpoint:
AWS Bedrock Streaming Support
Full streaming support for AWS Bedrock provider with all model families.
Stream Bedrock Responses:
Custom Ollama Base URLs
Configure custom base URLs for Ollama chat and embeddings endpoints.
Custom Ollama Server:
π New Features
New Event:
onMissingAiProvider- Handle cases where requested provider is not foundaiModel() Options: New
optionsstruct parameter to seed services with configurationRequest Merge Control:
AiBaseRequest.mergeServiceParams()andmergeServiceHeaders()now acceptoverrideboolean argumentOllama Embeddings: Support for
nomic-embed-textmodel for local embeddings
π§ Enhancements
Provider Defaults: All AI provider services inherit default chat and embedding parameters from
IAiServiceinterfaceService Configuration:
IAiService.configure()now accepts genericoptionsargument instead of justapiKeyRequest Clarity:
AiRequestclass renamed toAiChatRequestfor clarity and multi-modality supportError Handling: Added more
AiErrorexception handling for service JSON errorsDocker Retry Logic: Increased Model Runner retry time to 5 seconds with 10 max retries for large model loading
π Bug Fixes
Event Names: Corrected chat request event names to
onAIChatRequest,onAIChatRequestCreate, andonAIChatResponseHeaders Passthrough:
aiChat,aiChatStreamnow correctly pass headers toAiChatRequestRequest Building: BIFs now use
aiChatRequest()to build requests instead of manual constructionMCP Spec Compliance: Prompts now return
argumentskey instead ofargsper MCP specificationModel Setting:
AiChatRequestnow correctly sets model from paramsAPI Key Passthrough: API key now properly passed to service in
aiChat(),aiChatStream()BIFsCharacter Function: Fixed typo from
chr()tochar()in SSE formattingModel Retrieval:
AiModel.getModel()now correctly returns model name when using predefined providersOpenSearch URL: Fixed parameter conflict by using
requestUrlfor HTTP requests instead ofurl
π Documentation Updates
OpenSearch vector memory provider documentation
Multi-tenant usage tracking examples
Provider-specific options documentation
Custom embedding endpoint configuration
Bedrock streaming examples
π Upgrade Notes
This release is backward compatible. New features are opt-in:
Multi-tenant tracking - Add
tenantIdandusageMetadataoptions to requestsPredefined providers - Configure providers in module settings for cleaner code
OpenSearch - Use for scalable vector search in production
Custom embeddings - Point to self-hosted embedding services
Bedrock streaming - Enable real-time streaming for Bedrock models
π Thank You
Thank you to all contributors and users who continue to make BoxLang AI better!
Last updated