Interface ModelRouteParams

Parameters provided to the model router to aid in its selection process. This context allows the router to make informed decisions.

interface ModelRouteParams {
    taskHint: string;
    requestingAgentId?: string;
    personaId?: string;
    activePersona?: IPersonaDefinition;
    userId?: string;
    userSubscriptionTier?: ISubscriptionTier;
    query?: string;
    language?: string;
    optimizationPreference?: "balanced" | "cost" | "speed" | "quality";
    requiredCapabilities?: string[];
    preferredModelIds?: string[];
    preferredProviderIds?: string[];
    excludedModelIds?: string[];
    maxCostPerKInputTokens?: number;
    maxCostPerKOutputTokens?: number;
    userApiKeys?: Record<string, string>;
    customContext?: Record<string, any>;
    policyTier?: "safe" | "standard" | "mature" | "private-adult";
    contentIntent?: "general" | "romantic" | "erotic" | "violent" | "horror";
}

Properties

taskHint: string

A hint or classification of the current task (e.g., "code_generation", "summarization", "general_chat").

requestingAgentId?: string

The ID of the GMI or agent instance making the request.

personaId?: string

The ID of the active persona guiding the interaction.

activePersona?: IPersonaDefinition

The full active persona definition.

userId?: string

The ID of the user initiating the request.

userSubscriptionTier?: ISubscriptionTier

The subscription tier of the user, which might affect model availability or preference.

query?: string

The user's query or the primary input text for the task.

language?: string

The target language for the model's output (e.g., "en", "es", "ja").

optimizationPreference?: "balanced" | "cost" | "speed" | "quality"

A preference for optimizing model selection (e.g., for speed, cost, or quality). This can guide the router if multiple suitable models are found.

requiredCapabilities?: string[]

Explicitly required capabilities for the model (e.g., "tool_use", "vision_input", "json_mode"). The router must ensure the selected model supports all listed capabilities.

preferredModelIds?: string[]

A list of preferred model IDs, if any. The router should try to use one of these if suitable.

preferredProviderIds?: string[]

A list of preferred provider IDs, if any.

excludedModelIds?: string[]

A list of model IDs that should be excluded from consideration.

maxCostPerKInputTokens?: number

Maximum acceptable cost per 1000 input tokens (in USD), if cost is a critical factor.

maxCostPerKOutputTokens?: number

Maximum acceptable cost per 1000 output tokens (in USD).

userApiKeys?: Record<string, string>

User-provided API keys for specific providers, which might enable access to certain models.

customContext?: Record<string, any>

Additional custom parameters or context to aid routing decisions.

policyTier?: "safe" | "standard" | "mature" | "private-adult"

Content policy tier governing this request. Drives model selection: safe/standard use default censored models, mature/private-adult route to uncensored models via PolicyAwareRouter.

contentIntent?: "general" | "romantic" | "erotic" | "violent" | "horror"

Finer-grained content intent hint. A mature session doing combat narration vs. romance has different model preferences.