feat: Vercel AI Gateway provider and fx agent - #1052
Conversation
|
@xdotli @bingran-you can you give a vercel api key to just do a sanity check run? |
bd595be to
02cb2fb
Compare
|
Thanks for the implementation. I reviewed the current head locally and ran the regression/test gates plus a few runtime probes. I found two issues that I think should be addressed before merging:
Other than that, the provider routing, endpoint configuration, key isolation on the proxied path, and the existing regression gates looked good in my checks. I haven't done the real provider-backed E2E yet because I still need to run it with a valid |
57a3d92 to
a8e996a
Compare
|
Thanks for the follow-up fixes. I reviewed the current head (
Validation notes:
Please also make the new regression-test docstrings name PR #1052 or the guarded commit, per this repository's |
Register vercel/ in the provider registry so gateway models (vercel/<creator>/<model>, e.g. vercel/anthropic/claude-sonnet-4.5) route through the LiteLLM proxy with AI_GATEWAY_API_KEY. Declares the OpenAI-compatible completions/responses surfaces at /v1 and the Anthropic Messages surface at the root, so claude-agent-acp, codex-acp, and openhands can all run via the gateway. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fx speaks ACP natively (fx acp) and only talks to the Vercel AI Gateway, so it joins _NATIVE_PROTOCOL_AGENTS and skips the LiteLLM proxy; usage comes from the agent protocol response. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Review findings: replace the _NATIVE_PROTOCOL_AGENTS frozenset with a per-agent field (oracle stays a name check — it has no AgentConfig), update the ensure_litellm_runtime policy docstring, and drop fx's BENCHFLOW_PROVIDER_API_KEY mapping, which mis-wired foreign provider keys into AI_GATEWAY_API_KEY on non-vercel models. native_protocol is shim-only: remote manifests must not declare a key-isolation bypass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ed' stop reason The bypass now applies only to the agent's native_provider models and scrubs other providers' raw keys from the agent env; non-vercel models on fx fail fast. The ACP client normalizes fx's non-spec 'refused' stop reason to 'refusal' instead of failing validation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rovider Review blockers: hard-deny web_fetch/web_search via fx settings.json under the no-web policy; normalize fx's non-spec stop reasons (refused, max_output_tokens, max_model_turns) and usage keys at the ACP client so usage is captured once fx ships it (merged upstream, not in v0.0.7 — usage_source stays unavailable until then); copy native_provider through _acpx_wrap; bump fx pin to v0.0.7. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
a8e996a to
1316af0
Compare
|
Thanks for the review @ElegantLin
Also done: regression-test docstrings name PR #1052 per AGENTS.md, and the branch is rebased onto current main (5986 passed locally, ty + ruff clean; I don't hit your three environment-dependent failures here). Still pending on our side too: no AI_GATEWAY_API_KEY available, so the provider-backed E2E remains open. if the team has a key, happy to run the full matrix (claude/codex/openhands/opencode/openclaw/goose via proxy, fx direct). |
Adds the Vercel AI Gateway as a model provider. Benchmarks can now use models served through the gateway by writing model names like
vercel/anthropic/claude-sonnet-4.5, authenticated with a singleAI_GATEWAY_API_KEY.The gateway speaks both the OpenAI and Anthropic APIs. Since all agent traffic routes through the LiteLLM proxy, this covers every registered harness: claude, codex, openhands, plus opencode, openclaw, and goose.
Also registers fx (Vercel's own coding agent, ACP-native via
fx acp, pinned v0.0.7). fx speaks the AI SDK gateway wire protocol, which the LiteLLM proxy does not expose, so it declaresnative_provider="vercel": the proxy is bypassed only for vercel/ models, other models fail fast, and other providers' raw keys are scrubbed from the agent env. Under the no-web policy, web_fetch/web_search are hard-denied via fx's settings.json. The ACP client normalizes fx's non-spec stop reasons and usage keys; no released fx reports ACP usage yet (the feature is merged upstream), so fx runs report usage_source="unavailable" andrequiredusage tracking fails closed until the next fx release.Part of FrontierPhysics#53
Rebased on current main. All tests pass (5986),
tyandruffclean. Live gateway E2E still pending anAI_GATEWAY_API_KEY.