
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@aria-cli/models
Advanced tools
Model abstraction layer for ARIA with centralized model registry.
The @aria/models package provides:
The model registry is the single source of truth for all model definitions in ARIA. It centralizes model metadata, enabling zero-migration updates when models change.
import {
MODELS,
MODEL_REGISTRY,
getModelByTier,
getCliModels,
toShortName,
} from "@aria/models";
// Access models by constant
const opus = MODELS.opus_4_6;
console.log(opus.id); // "claude-opus-4-6"
console.log(opus.displayName); // "Claude Opus 4.6"
// Get model by tier
const powerfulModel = getModelByTier("powerful");
// Returns: { id: "claude-opus-4-6", tier: "powerful", ... }
// Get all models for CLI
const cliModels = getCliModels(false);
// Returns: [haiku_4_5, sonnet_4_5, opus_4_6]
// Convert model ID to short name
const shortName = toShortName("claude-opus-4-6");
// Returns: "opus-4.6"
// Model tier classification
type ModelTier = "fast" | "balanced" | "powerful" | "ensemble";
// Model provider
type ModelProvider = "anthropic" | "openai" | "google" | "xai" | "local";
// Model capabilities
type ModelCapability = "thinking" | "tools" | "vision" | "streaming";
// Complete model definition
interface ModelDefinition {
// Identity
id: string; // Full model ID (e.g., "claude-opus-4-6")
shortName: string; // Display name (e.g., "opus-4.6")
displayName: string; // UI name (e.g., "Opus 4.6")
// Classification
tier: ModelTier;
provider: ModelProvider;
// UI
description: string; // Short description for tooltips
tierDisplayName: string; // Tier name for UI (e.g., "Deep Thinking")
// Technical
capabilities: ModelCapability[];
maxContextTokens: number;
maxOutputTokens: number;
// Pricing (USD per 1M tokens)
pricing: {
inputPerMToken: number;
outputPerMToken: number;
};
}
export const MODELS = {
haiku_4_5: {
id: "claude-haiku-4-5-20251001",
shortName: "haiku-4.5",
displayName: "Claude Haiku 4.5",
tier: "fast",
tierDisplayName: "Quick",
provider: "anthropic",
description: "Fast, cost-effective model for high-volume tasks",
capabilities: ["tools", "streaming", "vision"],
maxContextTokens: 200_000,
maxOutputTokens: 8_192,
pricing: { inputPerMToken: 0.8, outputPerMToken: 4.0 },
},
sonnet_4_5: {
id: "claude-sonnet-4-5-20250929",
shortName: "sonnet-4.5",
displayName: "Claude Sonnet 4.5",
tier: "balanced",
tierDisplayName: "Standard",
provider: "anthropic",
description: "Balanced performance and cost for most tasks",
capabilities: ["tools", "streaming", "vision"],
maxContextTokens: 200_000,
maxOutputTokens: 8_192,
pricing: { inputPerMToken: 3.0, outputPerMToken: 15.0 },
},
opus_4_6: {
id: "claude-opus-4-6",
shortName: "opus-4.6",
displayName: "Claude Opus 4.6",
tier: "powerful",
tierDisplayName: "Deep Thinking",
provider: "anthropic",
description: "Most capable model with extended thinking for complex tasks",
capabilities: ["thinking", "tools", "streaming", "vision"],
maxContextTokens: 200_000,
maxOutputTokens: 8_192,
pricing: { inputPerMToken: 15.0, outputPerMToken: 75.0 },
},
};
export const MODEL_REGISTRY: readonly ReadonlyModelDefinition[] =
Object.values(MODELS);
// Get model by tier (returns first match)
function getModelByTier(tier: ModelTier): ModelDefinition | undefined;
// Get model by full ID
function getModelById(id: string): ModelDefinition | undefined;
// Get model by short name
function getModelByShortName(shortName: string): ModelDefinition | undefined;
// Get all models for a specific tier
function getModelsByTier(tier: ModelTier): ModelDefinition[];
// Get models suitable for CLI quick-select
function getCliModels(showEnsemble = true): ModelDefinition[];
// Convert model ID to short display name
function toShortName(modelId: string): string;
// Get tier display name for UI
function getTierDisplayName(tier: ModelTier): string;
// Check if a tier is valid
function isValidTier(tier: unknown): tier is ModelTier;
import { MODELS, ModelRouter } from "@aria/models";
export function createDefaultRouter(): ModelRouter {
return new ModelRouter({
fast: {
provider: MODELS.haiku_4_5.provider,
model: MODELS.haiku_4_5.id,
},
balanced: {
provider: MODELS.sonnet_4_5.provider,
model: MODELS.sonnet_4_5.id,
},
powerful: {
provider: MODELS.opus_4_6.provider,
model: MODELS.opus_4_6.id,
},
ensemble: [
{ provider: MODELS.opus_4_6.provider, model: MODELS.opus_4_6.id },
{ provider: "openai", model: "gpt-5.2" },
],
});
}
import { getCliModels } from "@aria/models";
const models: ModelOption[] = getCliModels(false).map((m) => ({
name: m.shortName,
description: m.tierDisplayName,
isCurrent: currentTier === m.tier,
}));
import { getModelByTier, ModelTier } from "@aria/models";
interface AriaConfig {
preferredTier?: ModelTier; // Store tier, not model name
}
// Load config and resolve tier to model
const config = loadConfig();
const tier = config.preferredTier || "balanced";
const model = getModelByTier(tier);
console.log(model?.shortName); // "sonnet-4.5"
If you're using hardcoded model IDs:
// ❌ Before (hardcoded)
const provider = "anthropic";
const model = "claude-opus-4-6";
// ✅ After (registry)
import { MODELS } from "@aria/models";
const provider = MODELS.opus_4_6.provider;
const model = MODELS.opus_4_6.id;
If you're storing model names in config:
// ❌ Before (stores model name)
interface Config {
preferredModel?: string; // "opus-4.6"
}
// ✅ After (stores tier)
import { ModelTier, getModelByTier } from "@aria/models";
interface Config {
preferredTier?: ModelTier; // "powerful"
}
// Resolution at runtime
const model = getModelByTier(config.preferredTier || "balanced");
Intelligently route queries to the best model based on characteristics.
import { ModelRouter } from "@aria/models";
const router = new ModelRouter({
fast: { provider: "anthropic", model: "claude-haiku-4-5-20251001" },
balanced: { provider: "anthropic", model: "claude-sonnet-4-5-20250929" },
powerful: { provider: "anthropic", model: "claude-opus-4-6" },
ensemble: [
{ provider: "anthropic", model: "claude-opus-4-6" },
{ provider: "openai", model: "gpt-5.2" },
],
});
// Chat by explicit tier
const response = await router.chat({
messages: [{ role: "user", content: "Write code" }],
tier: "powerful",
});
// Chat defaults to balanced tier
const response2 = await router.chat({
messages: [{ role: "user", content: "Simple translation task" }],
});
Declarative rules for automatic model selection based on content patterns.
import { codeGenerationRule, simpleQARule } from "@aria/models";
// Rules use registry for model selection
console.log(codeGenerationRule.model); // "claude-opus-4-6"
console.log(codeGenerationRule.tier); // "powerful"
// Available rules:
// - codeGenerationRule: Complex code tasks → Opus
// - analysisRule: Deep analysis → Opus
// - mathReasoningRule: Math/logic → Opus
// - creativeWritingRule: Creative content → Sonnet
// - simpleQARule: Simple questions → Haiku
// - summarizationRule: Summarization → Sonnet
Unified interface for all model providers:
import { AnthropicProvider } from "@aria/models";
const provider = new AnthropicProvider({
provider: "anthropic",
model: "claude-opus-4-6",
apiKey: process.env.ANTHROPIC_API_KEY!,
});
const response = await provider.chat({
messages: [{ role: "user", content: "Explain quantum computing" }],
temperature: 0.7,
maxTokens: 1000,
});
console.log(response.content);
Anthropic provider supports adaptive thinking and effort parameters:
const response = await provider.chat({
messages: [{ role: "user", content: "Solve this complex problem" }],
thinking: { mode: "adaptive" }, // Enable adaptive thinking
effort: "high", // Set reasoning depth
});
console.log(response.thinking); // Array of thinking blocks
console.log(response.usage); // Token usage including thinking tokens
ModelTier - Tier classification (fast, balanced, powerful, ensemble)ModelProvider - Provider type (anthropic, openai, google, xai, local)ModelCapability - Model capability (thinking, tools, vision, streaming)ModelDefinition - Complete model metadata (mutable)ReadonlyModelDefinition - Immutable model definition for safe external useModelRequest - Request parameters for model invocationModelResponse - Response from model invocationRouterConfig - Configuration for ModelRouter (fast, balanced, powerful, ensemble)RoutedRequest - Request with optional tier selectionProviderSelection - Result of provider/model selectionProviderConfig - Configuration for instantiating a providerCostConfig / CostStats - Cost-aware routing configuration and statisticsRateLimitConfig / RateLimitStats - Rate limiting configuration and statisticsEscalationConfig - Automatic tier escalation configurationFallbackConfig / FallbackResult - Provider fallback configuration and resultsRoutingRuleConfig / RoutingRule / RoutingMatch - Declarative routing rule typesMODELS - Typed model definitions objectMODEL_REGISTRY - Readonly array of all model definitionsgetModelByTier, getModelById, getModelByShortName, getModelsByTiergetCliModels, toShortName, getTierDisplayName, isValidTiercreateDefaultRouter, ModelRouterCostAwareRouter, defaultCostConfigRateLimiter, SlidingWindowRateLimiter, defaultRateLimitConfigEscalator, defaultEscalationConfigFallbackHandlercreateRoutingRule, RoutingRuleMatcherAnthropicProvider, OpenAIProvider, GoogleProvider, LocalProvider, BaseProvider# Install dependencies
pnpm install
# Run tests
pnpm test
# Build
pnpm build
# Type check
pnpm typecheck
MIT
FAQs
Unknown package
We found that @aria-cli/models demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.