Skip to content

DX-3062: add Neon AI Gateway models - #257

Merged
CahidArda merged 3 commits into
mainfrom
DX-3062
Oct 6, 2026
Merged

CahidArda merged 3 commits into
mainfrom
DX-3062

Conversation

@alitariksahin

Copy link
Copy Markdown
Collaborator

Summary

Follows upstash/box-backend#277 (Neon AI Gateway provider) and #285 (Neon harness rules), both merged and live on prod. This adds the Neon models to the SDKs and CLI.

  • NeonModel has 36 constants for Neon's short ids under neon/, for example NeonModel.GPT_5_5 for neon/gpt-5-5 and NeonModel.Claude_Haiku_4_5 for neon/claude-haiku-4-5. The Python SDK has the same list (GPT_5_5, CLAUDE_HAIKU_4_5, …). The Codex and OpenCode harness types accept them.
  • Harness inference: inferDefaultProvider and Python's infer_default_provider map neon/gpt-* to Codex, except gpt-oss-*. Every other Neon model maps to OpenCode, including GPT OSS, Claude, Gemini, Llama, Qwen, Kimi, GLM and Grok.
  • CLI picker: Neon groups appear for Codex and OpenCode only. Responses-only models (gpt-5-5-pro, gpt-5-3-codex) are Codex only. Chat-only models, including all Claude models, are OpenCode only, because Neon doesn't serve Claude on its Responses API. Claude Code gets no Neon group.
  • Neon credentials are a token plus a branch base URL, saved in the console. Runs use BoxApiKey.StoredKey, and the backend refuses raw keys and the managed key for Neon.

Tests

  • TypeScript SDK: typecheck clean, 488 tests passed.
  • CLI: typecheck clean, 549 tests passed.
  • Python SDK: 272 tests passed, Ruff clean.
  • Prettier is clean on the changed files.
  • Prod, both SDKs, cheapest models:
    • Codex with neon/gpt-5-nano as a plain run and a streamed run.
    • OpenCode with neon/gpt-oss-20b, neon/gemini-3-5-flash-lite and neon/claude-haiku-4-5, plain and streamed.
    • A model switch, run history, and the backend's refusals for Claude or chat-only models on Codex.

All test boxes were deleted.

🤖 Generated with Claude Code

NeonModel (neon/<neon-short-id>) in the TypeScript and Python SDKs for the
Codex and OpenCode harnesses, harness inference for neon/ models, and Neon
groups in the CLI picker. GPT models go to Codex; GPT OSS, Claude and the
other chat-only models go to OpenCode. Box does not run Claude Code with Neon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Oct 4, 2026

Copy link
Copy Markdown

DX-3062

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Public documentation conflicts with the implemented Grok and GPT OSS routing behavior.

Review effort: Balanced
Findings: 4 Low severity

Open (4)
What changed in this PR

Adds Neon AI Gateway model support across the TypeScript SDK, Python SDK, and CLI.

Changes:

  • Adds and exports 36 Neon model identifiers.
  • Infers Codex or OpenCode based on Neon endpoint support.
  • Adds CLI model groups, tests, parity documentation, and release notes.
File Description
packages/​sdk/​src/​types.ts Defines Neon models and harness compatibility.
packages/​sdk/​src/​index.ts Exports NeonModel.
packages/​sdk/​src/​client.ts Adds Neon provider inference.
packages/​sdk/​src/​__tests__/​types.test.ts Tests Neon identifiers.
packages/​sdk/​src/​__tests__/​infer-runner.test.ts Tests Neon inference.
packages/​python-sdk/​upstash_box/​types.py Mirrors Neon model definitions.
packages/​python-sdk/​upstash_box/​_common.py Mirrors provider inference.
packages/​python-sdk/​upstash_box/​__init__.py Exports NeonModel.
packages/​python-sdk/​tests/​_async/​test_models.py Tests Python identifiers.
packages/​python-sdk/​tests/​_async/​test_infer_provider.py Tests Python inference.
packages/​python-sdk/​PARITY.md Records SDK parity.
packages/​python-sdk/​CHANGELOG.md Documents Python changes.
packages/​cli/​src/​models.ts Adds Neon picker groups.
packages/​cli/​src/​__tests__/​models.test.ts Tests picker availability.
.changeset/​neon-ai-gateway-models.md Adds package release notes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .changeset/neon-ai-gateway-models.md Outdated
Comment thread packages/python-sdk/CHANGELOG.md Outdated
Comment thread packages/python-sdk/upstash_box/types.py Outdated
Comment thread packages/sdk/src/types.ts Outdated
GPT OSS is the exception to neon/gpt-* inferring Codex, and Grok 4.6 runs on
both harnesses, so it is not OpenCode-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread packages/cli/src/models.ts
Comment thread packages/python-sdk/upstash_box/_common.py Outdated
Comment thread packages/sdk/src/__tests__/infer-runner.test.ts Outdated
Comment thread packages/sdk/src/client.ts Outdated
…om endpoint support

- The create wizard no longer offers Upstash-managed or a raw key for neon/
  models, which the backend rejects; it sets the stored credential.
- Inference comments (TS and Python) and the test name describe default
  routing separately from endpoint support: Grok 4.6 defaults to OpenCode
  but Neon also serves it on the Responses API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The SDK and CLI implementations are consistent, documented, and covered by targeted tests.

Review effort: Balanced
Findings: None

Resolved since last review (4)

@CahidArda
CahidArda merged commit f12ace8 into main Oct 6, 2026
11 of 12 checks passed
@CahidArda
CahidArda deleted the DX-3062 branch October 6, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants