Skip to main content
Glama
006_add_model_priority.sql1.74 kB
-- Migration: Add priority column to model_configs -- Version: 1.1.0 -- Description: Adds priority field for model selection ordering within layers -- Add priority column to model_configs table ALTER TABLE model_configs ADD COLUMN IF NOT EXISTS priority INTEGER DEFAULT 0; -- Add index for efficient priority-based sorting within layers CREATE INDEX IF NOT EXISTS idx_model_configs_layer_priority_enabled ON model_configs (layer, priority ASC, enabled DESC); -- Update existing models with default priorities based on current order -- L0 models UPDATE model_configs SET priority = 0 WHERE id = 'openrouter-llama-3.3-70b-free'; UPDATE model_configs SET priority = 1 WHERE id = 'openrouter-grok-free'; UPDATE model_configs SET priority = 10 WHERE id = 'oss-llama-3-8b'; -- L1 models UPDATE model_configs SET priority = 0 WHERE id = 'openrouter-gemini-flash'; UPDATE model_configs SET priority = 1 WHERE id = 'openrouter-gpt-4o-mini'; UPDATE model_configs SET priority = 2 WHERE id = 'openai-gpt-4o-mini'; -- L2 models UPDATE model_configs SET priority = 0 WHERE id = 'openrouter-haiku'; UPDATE model_configs SET priority = 1 WHERE id = 'openrouter-gpt-4o-mini-l2'; UPDATE model_configs SET priority = 2 WHERE id = 'anthropic-haiku'; UPDATE model_configs SET priority = 3 WHERE id = 'openai-gpt-4o'; -- L3 models UPDATE model_configs SET priority = 0 WHERE id = 'openrouter-sonnet'; UPDATE model_configs SET priority = 1 WHERE id = 'anthropic-sonnet'; UPDATE model_configs SET priority = 2 WHERE id = 'openai-o1-preview'; UPDATE model_configs SET priority = 3 WHERE id = 'openai-o1-mini'; -- Set higher priority for any models that might not have been explicitly set UPDATE model_configs SET priority = 99 WHERE priority IS NULL;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/babasida246/ai-mcp-gateway'

If you have feedback or need assistance with the MCP directory API, please join our Discord server