Bx ai models
Skill ortus-boxlang/skills/boxlang-modules/bx-ai/bx-ai-models
BoxLang AI skills repository and Claude Plugin
npx -y skills add ortus-boxlang/skills --skill bx-ai-modelsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use this skill when configuring AI models with aiModel(): selecting providers, setting default parameters, structured output schemas, working with the service BIF aiService(), and pre-configuring providers in module settings.
SKILL.md
3.4 KB, as published. Nobody here has run it
bx-ai: Models & Providers
aiModel() BIF
// Signature
aiModel( provider="", params={}, apiKey="" )
Returns a reusable model object used in pipelines, agents, and direct calls.
// Basic — uses default provider from module config
model = aiModel()
// Specific provider
model = aiModel( provider: "openai" )
model = aiModel( provider: "claude" )
model = aiModel( provider: "gemini" )
model = aiModel( provider: "ollama" )
// With default parameters (applied to every call on this model)
model = aiModel(
provider: "openai",
params : {
model : "gpt-4o",
temperature: 0.7,
max_tokens : 2000
}
)
Available Providers
| Provider | Key Name | Notes |
|---|---|---|
| OpenAI | openai | GPT-4o, GPT-4-turbo, o1, etc. |
| Anthropic Claude | claude | Claude 3.5 Sonnet, Haiku, Opus |
| Google Gemini | gemini | Gemini 1.5 Pro, Flash |
| Grok (xAI) | grok | Grok-2 |
| Groq | groq | Ultra-fast inference; Llama, Mixtral |
| DeepSeek | deepseek | DeepSeek-R1, DeepSeek-V3 |
| Ollama | ollama | Local models — no API key needed |
| Mistral | mistral | Mistral Large, Pixtral |
| Perplexity | perplexity | Online search-augmented |
Module-Level Provider Config (Recommended)
Configure providers once in ModuleConfig.bx or boxlang.json rather than repeating API keys in every call:
// ModuleConfig.bx
moduleSettings = {
"bx-ai": {
defaultProvider: "openai",
providers: {
openai: {
apiKey: server.system.environment.OPENAI_API_KEY,
model : "gpt-4o"
},
claude: {
apiKey: server.system.environment.ANTHROPIC_API_KEY,
model : "claude-3-5-sonnet-20241022"
}
}
}
}
With pre-configured providers you can omit apiKey everywhere:
// No apiKey needed — resolved from module config
result = aiChat( "Hello" )
model = aiModel( provider: "claude" )
agent = aiAgent( name: "Bot", model: aiModel( provider: "openai" ) )
aiService() — Service-Level Access
// Get the global AI service
service = aiService()
// List configured providers
providers = service.getProviders()
// Get a specific provider instance
openaiProvider = service.getProvider( "openai" )
// Set the default provider at runtime
service.setDefaultProvider( "claude" )
Switching Models per Call
// Override model on a per-request basis via params
result = aiChat(
"Complex reasoning task",
{ model: "o1-preview", temperature: 1 },
{ provider: "openai" }
)
// Use a cheaper model for simple tasks
simple = aiChat(
"Is this email spam? Yes or No.",
{ model: "gpt-4o-mini", temperature: 0.0 },
{ provider: "openai" }
)
Common Pitfalls
- ❌
aiModel( "gpt-4o" )is WRONG —gpt-4ois a model name, not provider - ✅
aiModel( provider: "openai", params: { model: "gpt-4o" } )is correct - ❌ Never hardcode API keys in source code — use environment variables
- ✅ Configure all providers in module settings for centralized management