Update Snowflake Cortex models - #45
Merged
Merged
Conversation
The static Cortex catalog listed four Claude and two OpenAI models, at token limits that matched neither the endpoint nor the models. Refresh it against the Cortex REST API docs -- the endpoint `SnowflakeClient` actually calls -- and move model membership, display names, and windows into one table that capability inference reads too. `SNOWFLAKE_CORTEX_CATALOG` and `getSnowflakeCortexModelCapabilities()` in ai-config now own all of it; the bridge derives its `ModelInfo` list by mapping over the catalog. Adding a model is one entry in one file, and a catalog entry cannot disagree with a `models.custom` override of the same id -- previously the same policy was written twice, in two packages, and the two copies had drifted from the docs together. Catalog (current generations only, and Claude/OpenAI only since Cortex supports tool calling for nothing else): Opus 5, Opus 4.7, Sonnet 4.6, Opus 4.6, Haiku 4.5, GPT-5.4, GPT-5.2. Membership follows the REST availability table, which serves a different set than the AI_COMPLETE SQL function does: `claude-sonnet-5`, `claude-opus-4-8`, `openai-gpt-5.4-mini`, and `openai-gpt-5.4-nano` appear only under AI_COMPLETE and would fail REST with `400 unknown model`, while `openai-gpt-5.4` is REST-only. Output stays capped at 16,384 tokens for every model. That is a property of the REST endpoint, not of the models -- its rate-limit table lists 16,384 for all of them and the docs' examples send `max_tokens: 16384` -- so the higher AI_COMPLETE caps (up to 128k) must not be used here: `maxOutputTokens` flows straight into the request, and exceeding the cap is a documented `400 max tokens of <count> exceeded`. Context windows are corrected upward, which is what was actually wrong before: Opus 4.7/4.6 and Sonnet 4.6 were declared at 200k where Cortex serves 1M. The REST docs publish no per-model window, so these come from the AISQL restrictions table -- a window is a property of the model, unlike the output cap. Input and output share the window, so `maxInputTokens` is the window minus the output cap. https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-rest-api
Document that the 16,384-token REST cap is extrapolated conservatively to the two preview models whose rate-limit rows are not yet published. Add active bridge-level provider tests that validate catalog projection and credential gates without copying model literals.
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.
This PR updates the list of models available on Snowflake Cortex.