diff --git a/internal/providers/configs/thegrid.json b/internal/providers/configs/thegrid.json new file mode 100644 index 00000000..282e44c8 --- /dev/null +++ b/internal/providers/configs/thegrid.json @@ -0,0 +1,119 @@ +{ + "name": "The Grid", + "id": "thegrid", + "api_key": "$THEGRID_API_KEY", + "api_endpoint": "https://api.thegrid.ai/v1", + "type": "openai-compat", + "default_large_model_id": "agent-max", + "default_small_model_id": "text-standard", + "models": [ + { + "id": "agent-max", + "name": "Agent Max", + "context_window": 1000000, + "default_max_tokens": 128000, + "cost_per_1m_in": 1.5885, + "cost_per_1m_out": 1.5885, + "cost_per_1m_in_cached": 1.5885, + "cost_per_1m_out_cached": 1.5885, + "can_reason": true, + "supports_attachments": true + }, + { + "id": "agent-prime", + "name": "Agent Prime", + "context_window": 196608, + "default_max_tokens": 30000, + "cost_per_1m_in": 0.1422, + "cost_per_1m_out": 0.1422, + "cost_per_1m_in_cached": 0.1422, + "cost_per_1m_out_cached": 0.1422, + "can_reason": true, + "supports_attachments": false + }, + { + "id": "agent-standard", + "name": "Agent Standard", + "context_window": 128000, + "default_max_tokens": 16000, + "cost_per_1m_in": 0.02, + "cost_per_1m_out": 0.02, + "cost_per_1m_in_cached": 0.02, + "cost_per_1m_out_cached": 0.02, + "can_reason": true, + "supports_attachments": false + }, + { + "id": "code-max", + "name": "Code Max", + "context_window": 1000000, + "default_max_tokens": 128000, + "cost_per_1m_in": 1.7553, + "cost_per_1m_out": 1.7553, + "cost_per_1m_in_cached": 1.7553, + "cost_per_1m_out_cached": 1.7553, + "can_reason": true, + "supports_attachments": true + }, + { + "id": "code-prime", + "name": "Code Prime", + "context_window": 196608, + "default_max_tokens": 30000, + "cost_per_1m_in": 0.1493, + "cost_per_1m_out": 0.1493, + "cost_per_1m_in_cached": 0.1493, + "cost_per_1m_out_cached": 0.1493, + "can_reason": true, + "supports_attachments": false + }, + { + "id": "code-standard", + "name": "Code Standard", + "context_window": 128000, + "default_max_tokens": 16000, + "cost_per_1m_in": 0.0288, + "cost_per_1m_out": 0.0288, + "cost_per_1m_in_cached": 0.0288, + "cost_per_1m_out_cached": 0.0288, + "can_reason": true, + "supports_attachments": false + }, + { + "id": "text-max", + "name": "Text Max", + "context_window": 1000000, + "default_max_tokens": 128000, + "cost_per_1m_in": 1.68, + "cost_per_1m_out": 1.68, + "cost_per_1m_in_cached": 1.68, + "cost_per_1m_out_cached": 1.68, + "can_reason": true, + "supports_attachments": true + }, + { + "id": "text-prime", + "name": "Text Prime", + "context_window": 196608, + "default_max_tokens": 30000, + "cost_per_1m_in": 0.1017, + "cost_per_1m_out": 0.1017, + "cost_per_1m_in_cached": 0.1017, + "cost_per_1m_out_cached": 0.1017, + "can_reason": true, + "supports_attachments": false + }, + { + "id": "text-standard", + "name": "Text Standard", + "context_window": 128000, + "default_max_tokens": 16000, + "cost_per_1m_in": 0.03, + "cost_per_1m_out": 0.03, + "cost_per_1m_in_cached": 0.03, + "cost_per_1m_out_cached": 0.03, + "can_reason": true, + "supports_attachments": false + } + ] +} diff --git a/internal/providers/providers.go b/internal/providers/providers.go index f1c82b36..591bbf57 100644 --- a/internal/providers/providers.go +++ b/internal/providers/providers.go @@ -108,6 +108,9 @@ var scalewayConfig []byte //go:embed configs/synthetic.json var syntheticConfig []byte +//go:embed configs/thegrid.json +var theGridConfig []byte + //go:embed configs/vercel.json var vercelConfig []byte @@ -171,6 +174,7 @@ var providerRegistry = []ProviderFunc{ openRouterProvider, qiniuCloudProvider, scalewayProvider, + theGridProvider, vercelProvider, veniceProvider, vertexAIProvider, @@ -328,6 +332,10 @@ func syntheticProvider() catwalk.Provider { return loadProviderFromConfig(syntheticConfig) } +func theGridProvider() catwalk.Provider { + return loadProviderFromConfig(theGridConfig) +} + func vercelProvider() catwalk.Provider { return loadProviderFromConfig(vercelConfig) } diff --git a/pkg/catwalk/provider.go b/pkg/catwalk/provider.go index 7750698d..41d22579 100644 --- a/pkg/catwalk/provider.go +++ b/pkg/catwalk/provider.go @@ -60,6 +60,7 @@ const ( InferenceProviderBaseten InferenceProvider = "baseten" InferenceProviderMoonshot InferenceProvider = "moonshot" InferenceProviderAtlasCloud InferenceProvider = "atlascloud" + InferenceProviderTheGrid InferenceProvider = "thegrid" ) // Provider represents an AI provider configuration. @@ -140,6 +141,7 @@ func KnownProviders() []InferenceProvider { InferenceProviderBaseten, InferenceProviderMoonshot, InferenceProviderAtlasCloud, + InferenceProviderTheGrid, } }