Commit Graph

112 Commits

Author SHA1 Message Date
Cristina Poncela Cubeiro
63c61aac6f feat: image models 2026-05-04 17:07:02 +02:00
Cristina Poncela Cubeiro
cbf3c333ef revert 2026-05-04 15:43:45 +02:00
Cristina Poncela Cubeiro
e9414b0500 fix 2026-04-29 09:49:09 +02:00
Cristina Poncela Cubeiro
c3c10737d8 feat: image content 2026-04-28 13:43:28 +02:00
Mario Zechner
fbb5eed191 fix: honor telemetry for Cloudflare attribution headers 2026-04-27 23:49:14 +02:00
MC
d6e08b3da0 feat(ai): add Cloudflare Workers AI as a provider (#3851)
* feat(ai): add Cloudflare Workers AI as a provider

Cloudflare Workers AI hosts open-weight LLMs (Kimi K2.6, GPT-OSS,
GLM-4.7, Llama 4, Gemma 4, Nemotron 3) on Cloudflare's GPU network with
an OpenAI-compatible endpoint. Reuses the openai-completions API
protocol; the per-account URL contains a {CLOUDFLARE_ACCOUNT_ID}
placeholder resolved at request time by a small helper.

Pi automatically sets x-session-affinity for prefix caching:
https://developers.cloudflare.com/workers-ai/features/prompt-caching/

Auth: CLOUDFLARE_API_KEY (matches pi's *_API_KEY convention) +
CLOUDFLARE_ACCOUNT_ID. The User-Agent identifies traffic as
'pi-coding-agent' in Cloudflare analytics.

Verified end-to-end against a real Cloudflare account: 17 e2e tests
pass across stream/empty/tokens/unicode/tool-call-without-result/
total-tokens against @cf/moonshotai/kimi-k2.6.

Cloudflare AI Gateway is a separate, larger change (it requires routing
through provider-specific subpaths with the matching API protocol per
upstream) and will land in a follow-up PR.

* refactor(ai): move Cloudflare User-Agent and session-affinity flag to per-model metadata

Instead of conditionally setting them in openai-completions.ts based on
provider detection, declare them as model-level fields in the catalog
(headers + compat). This is consistent with how the github-copilot and
kimi-coding entries already declare their static headers.

  packages/ai/scripts/generate-models.ts: emit headers and compat fields
  on each cloudflare-workers-ai entry (CLOUDFLARE_STATIC_HEADERS).
  packages/ai/src/providers/openai-completions.ts: drop the
  isCloudflareProvider conditional that injected User-Agent and the
  isCloudflareWorkersAI override of sendSessionAffinityHeaders.
  packages/ai/src/models.generated.ts: re-spliced 8 cloudflare-workers-ai
  entries with headers + compat.

Behavior is unchanged - verified via fetch interceptor that User-Agent
and x-session-affinity / session_id / x-client-request-id are still sent
on outbound requests. 5/5 e2e tests pass.
2026-04-27 23:41:54 +02:00
Mario Zechner
9b103e5e41 fix(ai): replay DeepSeek V4 reasoning content
closes #3668
2026-04-24 19:32:51 +02:00
Mario Zechner
1e33492525 fix(coding-agent): harden clipboard copy
closes #3639
2026-04-24 12:55:58 +02:00
Mario Zechner
c96c2fcd1e fix(ai): correct gpt-5.5 context metadata 2026-04-24 10:42:44 +02:00
Mario Zechner
1312346199 fix(ai): expand Copilot eager streaming compat
closes #3575
2026-04-23 23:43:00 +02:00
Mario Zechner
ffa0f31239 fix(ai): support Anthropic eager tool streaming compat
closes #3575
2026-04-23 23:12:45 +02:00
Mario Zechner
f70d041e71 feat(ai): add GPT-5.5 Codex model 2026-04-23 21:36:16 +02:00
Mario Zechner
f0ebb327f2 fix(ai): set default Kimi Coding user agent closes #3586 2026-04-23 12:12:54 +02:00
Mario Zechner
6553141f69 fix(ai): add gemini 3.1 flash lite cloud code assist model
closes #3545
2026-04-22 19:13:51 +02:00
Mario Zechner
0bb0a58466 feat(ai): add Fireworks provider support closes #3519 2026-04-22 01:09:11 +02:00
Mario Zechner
a0a16c7762 fix(amazon-bedrock): restore regional endpoint resolution
closes #3481
closes #3485
closes #3486
closes #3487
closes #3488
2026-04-21 13:20:10 +02:00
Mario Zechner
3054fd7a3b fix(ai,coding-agent): support anthropic-style cache control for openai compatibles closes #3392 2026-04-20 17:12:05 +02:00
Armin Ronacher
a91978cf19 fix(ai): add temporary Anthropic Opus 4.7 model override 2026-04-16 17:06:23 +02:00
Mario Zechner
eb1cf80b10 fix(ai,coding-agent): replace deprecated kimi k2p5 model closes #3242 2026-04-16 12:06:24 +02:00
Vladyslav Tkachenko
a9bd8045d6 fix: update zai processing logic (#2855)
* feat: add new models and update zai processing logic

* chore(ai): removed overrides, simplify provider pick

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-05 23:44:17 +02:00
Kao Félix
758ede4da0 Enable tool streaming for newer Z.ai models (#2732) 2026-03-31 14:28:24 +02:00
Gordon Hui
17625cc8a2 feat(ai): add google-vertex gemini-3.1-pro-preview-customtools (#2610) 2026-03-27 02:45:58 +01:00
Mario Zechner
6dc43d6dd1 fix(ai): prune deprecated direct minimax models 2026-03-25 22:44:32 +01:00
简简简简
8705fbee54 fix(models): align minimax and zai defaults (#2445)
Update the coding-agent default model picks for ZAI, Cerebras,
and MiniMax so new sessions prefer the current model lineup.

Add the missing MiniMax-M2.1-highspeed direct provider entries
and normalize MiniMax Anthropic-compatible context limits so the
catalog matches the provider's supported model set.
2026-03-20 10:00:57 +01:00
Jheng-Hong Yang
68da22f18c feat(ai): add openai-codex gpt-5.4-mini (#2334) 2026-03-18 11:22:11 +01:00
Mario Zechner
a9f534adfc fix(ai): restore antigravity context override block 2026-03-18 00:16:01 +01:00
Mario Zechner
d70dfbeb3e fix(ai): correct Bedrock Claude 4.6 context window to 200k
Bedrock Claude Opus 4.6 and Sonnet 4.6 models have 200k context
window, not 1M. Removed incorrect overrides that were forcing these
models to 1M. The native Anthropic API models correctly remain at 1M.

closes #2305
2026-03-18 00:08:50 +01:00
Mario Zechner
747521227f fix(ai): correct Claude 4.6 context overrides closes #2286 2026-03-17 12:32:03 +01:00
Armin Ronacher
d574c03e19 Raise context length to 1M (#2135) 2026-03-14 01:34:25 +01:00
Mario Zechner
e4172e68d0 feat(ai): add claude-sonnet-4-6 to Antigravity, fix Claude thinking header detection, bump UA to 1.18.4
closes #1859
2026-03-06 13:27:35 +01:00
Mario Zechner
a31065166d Merge branch 'feat/use-mistral-sdk' 2026-03-05 23:49:29 +01:00
Mario Zechner
16ec7de29c fix(ai): cap gpt-5.4 context windows to 272k 2026-03-05 22:57:20 +01:00
Markus Ylisiurunen
8a6384a925 add support for gpt-5.4 2026-03-05 22:53:08 +01:00
Mario Zechner
8f2af2ae7e feat(ai): add github-copilot gpt-5.3-codex fallback closes #1853 2026-03-05 21:47:52 +01:00
Mario Zechner
2af0c98b5f fix(ai): support gemini-3.1 flash-lite and thinking matching
closes #1785
2026-03-04 20:17:58 +01:00
Abdeslam Yassine Agmar
eb9f1183ad refactor(ai): migrate mistral provider to conversations sdk 2026-03-03 17:25:50 +00:00
Mario Zechner
42579dd923 feat(ai,coding-agent): add OpenCode Go provider support closes #1757 2026-03-03 16:02:29 +01:00
Mario Zechner
7bd4c45d81 fix(ai,coding-agent): update antigravity gemini 3.1 models and headers
fixes #1761
2026-03-03 14:54:43 +01:00
audichuang
96cf7425ca feat(ai): add gemini-3.1-pro-preview to google-gemini-cli provider (#1599)
Add Gemini 3.1 Pro Preview model to the Cloud Code Assist (google-gemini-cli)
provider for parity with the google and google-vertex providers that already
include this model.

Tested and confirmed working via the Cloud Code Assist API endpoint.
2026-02-26 00:18:03 +01:00
Mario Zechner
18c7ab8a47 chore(models): update Gemini 3.1 provider catalogs and antigravity opus 4.6 2026-02-19 20:33:27 +01:00
Mario Zechner
0245b524e9 feat(ai): add claude sonnet 4.6 model fallback 2026-02-17 19:59:09 +01:00
Mario Zechner
fb83307092 feat(ai): add gpt-5.3-codex-spark model definition
Added to both OpenAI API and OpenAI Codex (ChatGPT OAuth) providers.
128k context window, text-only, research preview with zero cost.
Not yet functional via pi, may become available in the next few hours or days.
2026-02-12 20:49:03 +01:00
Nate Smyth
0a132a30a1 feat(ai): route copilot claude via anthropic messages api 2026-02-12 18:41:12 +01:00
Mario Zechner
1caadb2e2a fix(ai): use parametersJsonSchema for Google tool declarations, revert Antigravity opus model
- Use parametersJsonSchema instead of parameters for Gemini tool declarations
  to support full JSON Schema (anyOf, oneOf, const, etc.)
- Keep legacy parameters field for Claude models on Cloud Code Assist, where
  the API translates parameters into Anthropic's input_schema
- Revert claude-opus-4-6-thinking back to claude-opus-4-5-thinking (model
  doesn't exist on the Antigravity endpoint)

fixes #1398
2026-02-08 15:53:17 +01:00
Mario Zechner
2c3f624348 fix(ai): correct opencode context windows for Claude Sonnet 4/4.5
fixes #1383
2026-02-08 14:35:07 +01:00
Shashank Goyal
3fb33da429 feat(ai): add openrouter "auto" model alias (#1361)
Add a manually inserted "auto" model entry for OpenRouter alongside
the existing "openrouter/auto" entry, allowing users to select the
auto-routing model with a shorter identifier.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 15:35:21 +01:00
calvin-hpnet
2ae668823c feat(antigravity): replace Claude Opus 4.5 with 4.6 (#1345)
Claude Opus 4.5 has been replaced by Claude Opus 4.6 on the
Antigravity (Google Cloud Code Assist) platform.

- Update model definition in generate-models.ts
- Update generated models output
2026-02-07 03:28:54 +01:00
Mario Zechner
c07277b9ac fix(ai): set opus 4.6 context window to 200k 2026-02-05 22:25:26 +01:00
Mario Zechner
712d0c6ada fix(ai,coding-agent): fix Bedrock Opus 4.6 model IDs, cache pricing, and add EU profile
- Remove :0 suffix from Opus 4.6 Bedrock model IDs (not valid for this model)
- Fix us/eu Opus 4.6 cache pricing (0.5/6.25 instead of 1.5/18.75)
- Add missing eu.anthropic.claude-opus-4-6-v1 inference profile
- Fix coding-agent default Bedrock model ID to match catalog
2026-02-05 22:21:22 +01:00
Mario Zechner
b94c17885d feat(ai): add Claude Opus 4.6 and GPT-5.3 Codex models 2026-02-05 20:34:56 +01:00