Skip to content

Add Vercel AI SDK example (ai-sdk/, @ai-sdk/openai-compatible) #14

Closed

Description

@cloudgpuapp

@claude please add a Vercel AI SDK example folder to this repo. Docs/example change only; open a PR from a claude/issue-* branch and merge it when checks pass.

Why

The Vercel AI SDK docs (vercel/ai, content/providers/04-openai-compatible-providers/) only list a provider when the provider publishes its own public AI SDK instructions. This folder is that public reference for CloudGPU.

Add ai-sdk/

  1. ai-sdk/package.json: "type": "module", dependencies ai and @ai-sdk/openai-compatible (current major versions on npm), scripts generate and stream.
  2. ai-sdk/generate.mjs: createOpenAICompatible({ name: 'cloudgpu', apiKey: process.env.CLOUDGPU_API_KEY, baseURL: 'https://cloudgpu.app/v1' }), then generateText with cloudgpu.chatModel('kimi-k3') and a short prompt; print the text. Exit with a clear message if CLOUDGPU_API_KEY is unset.
  3. ai-sdk/stream.mjs: same provider, streamText with cloudgpu.chatModel('glm-5.2'), print textStream chunks, and set includeUsage: true on the provider.
  4. ai-sdk/README.md: what it is (CloudGPU's OpenAI-compatible model API used through @ai-sdk/openai-compatible), install (npm install ai @ai-sdk/openai-compatible), export CLOUDGPU_API_KEY=... (keys from https://cloudgpu.app/api/console), the provider snippet, both examples, how to switch model IDs (e.g. kimi-k3, glm-5.2, deepseek-v4.1-flash, deepseek-v4-pro; current list from GET https://cloudgpu.app/v1/models), and links to https://cloudgpu.app/api/docs and the AI SDK OpenAI Compatible provider docs (https://ai-sdk.dev/providers/openai-compatible-providers).
  5. Root README.md: add one table row only, [ai-sdk/](ai-sdk/README.md) | "Vercel AI SDK (@ai-sdk/openai-compatible): generateText and streamText". Do not change anything else in the root README.

Constraints

  • In the new files: no prices, no speed/latency/region claims, no words like cheap/cheapest, no "open source"/"open-weight", and name only the four model IDs above (all live on /v1/models as of 2026-10-31 11:00 UTC+8).
  • Never commit a real API key; use process.env.CLOUDGPU_API_KEY only.
  • No real key is available in CI, so verify with node --check on both .mjs files and an npm install --dry-run (or equivalent) in ai-sdk/; say in the PR that no live call was made.

Done when

ai-sdk/ with the four files is on main, and the root README has the new row.

Activity

  1. claude commented on Oct 31, 2026

    @claude
    Contributor

    Claude finished @mrhy7176's task in 1m 0s —— View job


    Vercel AI SDK example: PR open, not merged

    • Added ai-sdk/package.json, generate.mjs, stream.mjs and README.md
    • Added one table row to the root README.md
    • Pushed and opened PR Add Vercel AI SDK example (ai-sdk/) #15, which has Closes #14 in its body: Add Vercel AI SDK example (ai-sdk/) #15
    • npm install --dry-run in ai-sdk/ succeeded. It resolved ai 6.0.320 and @ai-sdk/openai-compatible 2.0.88, so package.json uses ^6.0.0 and ^2.0.0.
    • node --check on both .mjs files was not run. The sandbox needed approval for that command.
    • Not merged. gh pr checks reports no checks on this repo. The issue asks for node --check before merging, and I couldn't run it, so I left the merge for you.

    No live API call was made, because there is no key in CI. The new files contain no prices, speed or region claims, and no model IDs beyond kimi-k3, glm-5.2, deepseek-v4.1-flash and deepseek-v4-pro.

    To finish, run node --check ai-sdk/generate.mjs ai-sdk/stream.mjs and merge PR #15. Or allow node --check for me and I'll run it and merge.
    · Branch

  2. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor

    ✅ claude-automerge:PR #15 已 squash 合并到 main,分支已删除。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions