Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feat(providers): add a Vercel AI Gateway example profile (fx)

Đang mở Phù hợp với người mới
#4,440 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
yaml
Lĩnh vực
devops

Hướng nghiên cứu

Đọc providers/openrouter.yaml và so sánh cấu trúc profile của nó với providers/vercel-ai-gateway.yaml được đề xuất. Thêm các đường dẫn binary của fx và giới hạn AI_GATEWAY_API_KEY trong phạm vi ai-gateway.vercel.sh:443; chạy openshell profile lint -f providers/vercel-ai-gateway.yaml và cập nhật bài kiểm tra liệt kê profile của openshell-server để nhận diện id mới. Hoàn tất khi lint chạy thành công và danh mục ví dụ cùng các bài kiểm tra liệt kê profile chấp nhận profile mới.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

state:triage-needed
User Story

I use OpenShell 0.1.x with the Docker driver to run coding agents in sandboxes for a benchmark I’m building.
I need to run Vercel’s fx agent inside those sandboxes, with its AI Gateway key injected by OpenShell instead of exposed to the agent.
There is no example profile for the Vercel AI Gateway today, so I have to write and review the credential and endpoint scope myself.

Problem Statement

providers/ has example profiles for Claude Code, Codex, Copilot, Cursor and OpenRouter (used by OpenCode), but none for the Vercel AI Gateway. Clients like fx authenticate to https://ai-gateway.vercel.sh with AI_GATEWAY_API_KEY as a bearer token, and OpenShell has no reviewed profile that scopes that key to that endpoint.

Impact / Why This Matters

Without this feature, users must write their own provider profile for the AI Gateway, including the binaries paths and the credential scope.
This results in each user getting those two parts right on their own: fx’s installer puts the binary in ~/.local/bin, so a profile that only names /usr/local/bin/fx matches nothing and the key is never injected, and the easy fix is widening binaries or the endpoints

Proposed Design

Ship a reviewed example profile at providers/vercel-ai-gateway.yaml, in the same shape as providers/openrouter.yaml. Its header documents the reference fx layout (/usr/local/bin/fx, or ~/.local/bin/fx from fx's installer), the credential scope, and what it does not cover (Vercel sign-in, fx update checks, MCP servers).

Notional workflow:

openshell profile lint   -f providers/vercel-ai-gateway.yaml
openshell profile import -f providers/vercel-ai-gateway.yaml --global

AI_GATEWAY_API_KEY=your-key openshell provider create \
  --name vercel-ai-gateway --type vercel-ai-gateway --from-existing

openshell sandbox create --provider vercel-ai-gateway --from your-fx-image -- \
  fx ask 'reply with OK'

The sandbox sees only a placeholder for AI_GATEWAY_API_KEY. OpenShell injects the real key only on requests from the fx binary to ai-gateway.vercel.sh:443.

Acceptance Criteria
  • openshell profile lint -f providers/vercel-ai-gateway.yaml passes.
  • With the provider attached, fx ask 'reply with OK' in a sandbox gets a model response through ai-gateway.vercel.sh.
  • The workload environment contains a placeholder, not the real key.
  • Requests to other hosts, or from binaries not listed in the profile, are denied and logged as policy denials.
Alternatives Considered
  • Each user writes their own profile: works, but repeats the binaries and credential-scope review per user, which is what the example profiles exist to avoid.
  • Reuse the existing openai profile: its endpoints and env var point at api.openai.com and OPENAI_API_KEY, so it does not cover ai-gateway.vercel.sh or AI_GATEWAY_API_KEY.
  • A gateway interceptor that vends the profile: valid for operators who want a managed catalog, but heavier than a reviewed YAML file for a single static endpoint.
  • Supervisor middleware: it inspects allowed traffic and does not scope or inject credentials, so it does not address the gap.
  • A tutorial like "Run Pi with OpenRouter": useful later, but it would still need a profile to point at.
  • Naming the profile fx: the key and endpoint belong to the gateway, and other AI SDK clients use the same key, so it follows openrouter and is named after the service.
Agent Investigation
  • Checked main (e585b49): no profile, doc, issue or PR mentions Vercel, AI Gateway or fx.
  • fx source (vercel-labs/fx): default base URL https://ai-gateway.vercel.sh, Authorization: Bearer with AI_GATEWAY_API_KEY (VERCEL_OIDC_TOKEN as an alternative); the installer places the binary in ~/.local/bin.
  • A draft providers/vercel-ai-gateway.yaml passes openshell profile lint (v0.1.3) and the openshell-providers example catalog test; the openshell-server profile listing test needs the new id added.
  • Built fx 0.0.13 from source and ran it in a v0.1.3 sandbox (Docker driver) with the draft profile: the policy admitted ai-gateway.vercel.sh. An end-to-end request with a real key has not been run yet.
Checklist
  • I've reviewed existing issues and the published docs
  • This is a design proposal, not a "please build this" request
Ngôn ngữ chính
Rust
Star
15.4k
Fork
1.7k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
374

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/OpenShell

Tất cả issue của NVIDIA/OpenShell

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.