feat: add The Grid provider - #480
Open
BarneyChambers wants to merge 1 commit into
Open
Conversation
The Grid is an OpenAI-compatible inference platform where each model id routes across a pool of underlying models rather than naming a single one. Adds the provider config plus its registration and InferenceProvider constant.
Author
|
Please let me know if you have any style-guides for submitting pull requests and I would be happy to amend my request to align with that. Thanks for reading! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds The Grid as an OpenAI-compatible provider with 9 models:
internal/providers/configs/thegrid.json, its registration ininternal/providers/providers.go, and theInferenceProviderconstant inpkg/catwalk/provider.go— the same three-file shape as #373.The Grid is an OpenAI-compatible inference platform (docs, API base
https://api.thegrid.ai/v1). These records are generated from the same source of truth that drives our live/v1/modelsendpoint, so the values in this PR match what the API enforces.How these values are derived
Grid models differ from single-model providers in ways that affect the values here:
context − max output.cost_per_1m_in,cost_per_1m_out, and both cached figures are equal by design rather than by omission. The published figure is the trailing 7-day volume-weighted average of the live spot price; we refresh it whenever we update these records.typeisopenai-compatandapi_keyis$THEGRID_API_KEY, matching how the other third-party OpenAI-compatible providers inconfigs/declare themselves.supports_attachmentsis true only on the*-maxtier, which is whatarchitecture.input_modalitiesreports in our catalog; the prime and standard tiers are text-only.Models
agent-maxagent-primeagent-standardcode-maxcode-primecode-standardtext-maxtext-primetext-standarddefault_large_model_idisagent-maxanddefault_small_model_idistext-standard.Verification
go build ./...,go vet ./..., andgo test ./...all pass on this branch (Go 1.26), andgofmt -l ./internal ./pkgis clean.TestValidDefaultModels/The_Gridpasses both default model ids resolve within the models array.catwalk.Providerwith every field populated (no JSON key silently missing a struct tag):type=openai-compat,endpoint=https://api.thegrid.ai/v1,key=$THEGRID_API_KEY, 9 models with limits, prices, and capability flags all set.curl -sS https://api.thegrid.ai/v1/models.These entries are maintained by an automated generator with daily reconciliation against the published registry, so drift is caught and corrected promptly. Happy to add a
cmd/thegridgenerator and wire it into the auto-update workflow (the #463 shape) if you'd prefer these refreshed automatically rather than by PR.