diff --git a/internal/agent/hyper/provider.json b/internal/agent/hyper/provider.json index f7bd6b50fc170a4ac1bd23058a9398b00e9693c4..7af33dea55671980ed19e250e82ff9576b2468eb 100644 --- a/internal/agent/hyper/provider.json +++ b/internal/agent/hyper/provider.json @@ -1 +1 @@ -{"name":"Charm Hyper","id":"hyper","api_endpoint":"https://hyper.charm.land/api/v1/fantasy","type":"hyper","default_large_model_id":"claude-opus-4-5","default_small_model_id":"claude-haiku-4-5","models":[{"id":"claude-haiku-4-5","name":"Claude Haiku 4.5","cost_per_1m_in":1,"cost_per_1m_out":5,"cost_per_1m_in_cached":1.25,"cost_per_1m_out_cached":0.1,"context_window":200000,"default_max_tokens":64000,"can_reason":true,"supports_attachments":true,"options":{}},{"id":"claude-opus-4-5","name":"Claude Opus 4.5","cost_per_1m_in":5,"cost_per_1m_out":25,"cost_per_1m_in_cached":6.25,"cost_per_1m_out_cached":0.5,"context_window":200000,"default_max_tokens":64000,"can_reason":true,"supports_attachments":true,"options":{}},{"id":"claude-opus-4-6","name":"Claude Opus 4.6","cost_per_1m_in":5,"cost_per_1m_out":25,"cost_per_1m_in_cached":6.25,"cost_per_1m_out_cached":0.5,"context_window":1000000,"default_max_tokens":126000,"can_reason":true,"reasoning_levels":["low","medium","high","max"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"claude-sonnet-4-5","name":"Claude Sonnet 4.5","cost_per_1m_in":3,"cost_per_1m_out":15,"cost_per_1m_in_cached":3.75,"cost_per_1m_out_cached":0.3,"context_window":200000,"default_max_tokens":64000,"can_reason":true,"supports_attachments":true,"options":{}},{"id":"claude-sonnet-4-6","name":"Claude Sonnet 4.6","cost_per_1m_in":3,"cost_per_1m_out":15,"cost_per_1m_in_cached":3.75,"cost_per_1m_out_cached":0.3,"context_window":1000000,"default_max_tokens":64000,"can_reason":true,"reasoning_levels":["low","medium","high","max"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gemini-3-flash","name":"Gemini 3 Flash","cost_per_1m_in":0.5,"cost_per_1m_out":3,"cost_per_1m_in_cached":0.05,"cost_per_1m_out_cached":0,"context_window":1000000,"default_max_tokens":8000,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gemini-3-pro-preview","name":"Gemini 3 Pro","cost_per_1m_in":2,"cost_per_1m_out":12,"cost_per_1m_in_cached":0.2,"cost_per_1m_out_cached":0,"context_window":1000000,"default_max_tokens":8000,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gemini-3.1-pro-preview","name":"Gemini 3.1 Pro","cost_per_1m_in":2,"cost_per_1m_out":12,"cost_per_1m_in_cached":0.2,"cost_per_1m_out_cached":0,"context_window":1000000,"default_max_tokens":8000,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"glm-4.7","name":"GLM-4.7","cost_per_1m_in":0.6,"cost_per_1m_out":2.2,"cost_per_1m_in_cached":0,"cost_per_1m_out_cached":0,"context_window":200000,"default_max_tokens":8000,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":false,"options":{}},{"id":"glm-4.7-flashx","name":"GLM-4.7 Flash","cost_per_1m_in":0.06,"cost_per_1m_out":0.4,"cost_per_1m_in_cached":0.01,"cost_per_1m_out_cached":0,"context_window":200000,"default_max_tokens":8000,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":false,"options":{}},{"id":"glm-5","name":"GLM-5","cost_per_1m_in":1,"cost_per_1m_out":3.2,"cost_per_1m_in_cached":0.2,"cost_per_1m_out_cached":0,"context_window":202800,"default_max_tokens":8000,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":false,"options":{}},{"id":"gpt-5.1-codex","name":"GPT-5.1 Codex","cost_per_1m_in":1.25,"cost_per_1m_out":10,"cost_per_1m_in_cached":0.125,"cost_per_1m_out_cached":0.125,"context_window":400000,"default_max_tokens":128000,"can_reason":true,"reasoning_levels":["minimal","low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gpt-5.1-codex-max","name":"GPT-5.1 Codex Max","cost_per_1m_in":1.25,"cost_per_1m_out":10,"cost_per_1m_in_cached":0.125,"cost_per_1m_out_cached":0.125,"context_window":400000,"default_max_tokens":128000,"can_reason":true,"reasoning_levels":["minimal","low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gpt-5.1-codex-mini","name":"GPT-5.1 Codex Mini","cost_per_1m_in":0.25,"cost_per_1m_out":2,"cost_per_1m_in_cached":0.025,"cost_per_1m_out_cached":0.025,"context_window":400000,"default_max_tokens":128000,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gpt-5.2","name":"GPT-5.2","cost_per_1m_in":1.75,"cost_per_1m_out":14,"cost_per_1m_in_cached":0.175,"cost_per_1m_out_cached":0.175,"context_window":400000,"default_max_tokens":128000,"can_reason":true,"reasoning_levels":["minimal","low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gpt-5.2-codex","name":"GPT-5.2 Codex","cost_per_1m_in":1.75,"cost_per_1m_out":14,"cost_per_1m_in_cached":0.175,"cost_per_1m_out_cached":0.175,"context_window":400000,"default_max_tokens":128000,"can_reason":true,"reasoning_levels":["minimal","low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gpt-5.3-codex","name":"GPT-5.3 Codex","cost_per_1m_in":1.75,"cost_per_1m_out":14,"cost_per_1m_in_cached":0.175,"cost_per_1m_out_cached":0.175,"context_window":400000,"default_max_tokens":128000,"can_reason":true,"reasoning_levels":["minimal","low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gpt-5.4","name":"GPT-5.4","cost_per_1m_in":2.5,"cost_per_1m_out":15,"cost_per_1m_in_cached":0.25,"cost_per_1m_out_cached":0,"context_window":1050000,"default_max_tokens":128000,"can_reason":true,"reasoning_levels":["low","medium","high","xhigh"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"gpt-5.4-pro","name":"GPT-5.4 Pro","cost_per_1m_in":30,"cost_per_1m_out":180,"cost_per_1m_in_cached":0,"cost_per_1m_out_cached":0,"context_window":1050000,"default_max_tokens":128000,"can_reason":true,"reasoning_levels":["medium","high","xhigh"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}},{"id":"grok-4.20","name":"Grok 4.20","cost_per_1m_in":2,"cost_per_1m_out":6,"cost_per_1m_in_cached":0,"cost_per_1m_out_cached":0.2,"context_window":200000,"default_max_tokens":20000,"can_reason":true,"supports_attachments":true,"options":{}},{"id":"grok-code-fast-1","name":"Grok Code Fast","cost_per_1m_in":0.2,"cost_per_1m_out":1.5,"cost_per_1m_in_cached":0,"cost_per_1m_out_cached":0.02,"context_window":131072,"default_max_tokens":13107,"can_reason":true,"supports_attachments":false,"options":{}},{"id":"kimi-k2-0905","name":"Kimi K2","cost_per_1m_in":0.6,"cost_per_1m_out":2.5,"cost_per_1m_in_cached":0.15,"cost_per_1m_out_cached":0,"context_window":256000,"default_max_tokens":8000,"can_reason":false,"supports_attachments":false,"options":{}},{"id":"kimi-k2.5","name":"Kimi K2.5","cost_per_1m_in":0.6,"cost_per_1m_out":3,"cost_per_1m_in_cached":0.1,"cost_per_1m_out_cached":0,"context_window":262114,"default_max_tokens":8000,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":true,"options":{}}]} \ No newline at end of file +{"name":"Charm Hyper","id":"hyper","api_endpoint":"https://hyper.charm.land/api/v1/fantasy","type":"hyper","default_large_model_id":"kimi-k2.5","default_small_model_id":"gpt-oss-120b","models":[{"id":"kimi-k2.5","name":"Kimi-K2.5","cost_per_1m_in":0.55,"cost_per_1m_out":3,"cost_per_1m_in_cached":0.275,"cost_per_1m_out_cached":1.1,"context_window":262144,"default_max_tokens":26214,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":false,"options":{}},{"id":"glm-5","name":"GLM-5","cost_per_1m_in":1,"cost_per_1m_out":3,"cost_per_1m_in_cached":0.5,"cost_per_1m_out_cached":0,"context_window":202752,"default_max_tokens":20275,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":false,"options":{}},{"id":"gpt-oss-120b","name":"gpt-oss-120b","cost_per_1m_in":0.02,"cost_per_1m_out":0.1,"cost_per_1m_in_cached":0.01,"cost_per_1m_out_cached":0.04,"context_window":131072,"default_max_tokens":13107,"can_reason":true,"reasoning_levels":["low","medium","high"],"default_reasoning_effort":"medium","supports_attachments":false,"options":{}}]} \ No newline at end of file diff --git a/schema.json b/schema.json index 3f9754158f3bc91cc1b6570d5e5393a6b594c22d..c3f444bab103c4fa5ba05ff9e3930a338c462588 100644 --- a/schema.json +++ b/schema.json @@ -64,10 +64,7 @@ "description": "Model configurations for different model types" }, "providers": { - "additionalProperties": { - "$ref": "#/$defs/ProviderConfig" - }, - "type": "object", + "$ref": "#/$defs/Map[string,github.com/charmbracelet/crush/internal/config.ProviderConfig]", "description": "AI provider configurations" }, "mcp": { @@ -265,88 +262,8 @@ }, "type": "object" }, - "Model": { - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "cost_per_1m_in": { - "type": "number" - }, - "cost_per_1m_out": { - "type": "number" - }, - "cost_per_1m_in_cached": { - "type": "number" - }, - "cost_per_1m_out_cached": { - "type": "number" - }, - "context_window": { - "type": "integer" - }, - "default_max_tokens": { - "type": "integer" - }, - "can_reason": { - "type": "boolean" - }, - "reasoning_levels": { - "items": { - "type": "string" - }, - "type": "array" - }, - "default_reasoning_effort": { - "type": "string" - }, - "supports_attachments": { - "type": "boolean" - }, - "options": { - "$ref": "#/$defs/ModelOptions" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "id", - "name", - "cost_per_1m_in", - "cost_per_1m_out", - "cost_per_1m_in_cached", - "cost_per_1m_out_cached", - "context_window", - "default_max_tokens", - "can_reason", - "supports_attachments", - "options" - ] - }, - "ModelOptions": { - "properties": { - "temperature": { - "type": "number" - }, - "top_p": { - "type": "number" - }, - "top_k": { - "type": "integer" - }, - "frequency_penalty": { - "type": "number" - }, - "presence_penalty": { - "type": "number" - }, - "provider_options": { - "type": "object" - } - }, + "Map[string,github.com/charmbracelet/crush/internal/config.ProviderConfig]": { + "properties": {}, "additionalProperties": false, "type": "object" }, @@ -478,89 +395,6 @@ "additionalProperties": false, "type": "object" }, - "ProviderConfig": { - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the provider", - "examples": [ - "openai" - ] - }, - "name": { - "type": "string", - "description": "Human-readable name for the provider", - "examples": [ - "OpenAI" - ] - }, - "base_url": { - "type": "string", - "format": "uri", - "description": "Base URL for the provider's API", - "examples": [ - "https://api.openai.com/v1" - ] - }, - "type": { - "type": "string", - "enum": [ - "openai", - "openai-compat", - "anthropic", - "gemini", - "azure", - "vertexai" - ], - "description": "Provider type that determines the API format", - "default": "openai" - }, - "api_key": { - "type": "string", - "description": "API key for authentication with the provider", - "examples": [ - "$OPENAI_API_KEY" - ] - }, - "oauth": { - "$ref": "#/$defs/Token", - "description": "OAuth2 token for authentication with the provider" - }, - "disable": { - "type": "boolean", - "description": "Whether this provider is disabled", - "default": false - }, - "system_prompt_prefix": { - "type": "string", - "description": "Custom prefix to add to system prompts for this provider" - }, - "extra_headers": { - "additionalProperties": { - "type": "string" - }, - "type": "object", - "description": "Additional HTTP headers to send with requests" - }, - "extra_body": { - "type": "object", - "description": "Additional fields to include in request bodies" - }, - "provider_options": { - "type": "object", - "description": "Additional provider-specific options for this provider" - }, - "models": { - "items": { - "$ref": "#/$defs/Model" - }, - "type": "array", - "description": "List of models available from this provider" - } - }, - "additionalProperties": false, - "type": "object" - }, "SelectedModel": { "properties": { "model": { @@ -671,30 +505,6 @@ "completions" ] }, - "Token": { - "properties": { - "access_token": { - "type": "string" - }, - "refresh_token": { - "type": "string" - }, - "expires_in": { - "type": "integer" - }, - "expires_at": { - "type": "integer" - } - }, - "additionalProperties": false, - "type": "object", - "required": [ - "access_token", - "refresh_token", - "expires_in", - "expires_at" - ] - }, "ToolGrep": { "properties": { "timeout": {