ai-model-web

Call CloudBase AI models from browser-based Web applications with streaming text.

Updated May 14, 2026
One-click install
npx skills add https://github.com/williamwang25/ams-admin --skill ai-model-web-williamwang25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-model-web
Source: https://github.com/williamwang25/ams-admin/tree/main/.windsurf/skills/cloudbase/references/ai-model-web
Command: npx skills add https://github.com/williamwang25/ams-admin --skill ai-model-web-williamwang25

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It removes the friction of calling CloudBase AI models from browser-based Web applications by providing a safe, correct way to select models, verify eligibility, and ensure the target model is enabled before generating text.

Core Features & Use Cases

  • Browser-first AI calls for Web UIs: Supports calling AI models directly from the frontend (Vue/React/Next/Nuxt/SPAs/admin dashboards) without proposing a Node.js or proxy first.
  • Streaming and non-streaming text generation: Use generateText for single responses or streamText for incremental token/chunk delivery.
  • Production guardrails for model readiness: Enforces a two-step preflight (Token Credits resource pack eligibility, then DescribeAIModels + catalog lookup + UpdateAIModel when needed), so runtime “model not found/enabled” failures are minimized.

Quick Start

Use the ai-model-web skill to call the requested model from the page by streaming the generated text into your UI, after first confirming Token Credits eligibility and ensuring the exact model SKU is enabled in the cloudbase group.

Frequently Asked Questions about ai-model-web

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I call CloudBase AI models for text generation directly from a Vue or React frontend?

You can call CloudBase AI models directly from a Vue or React frontend by verifying Token Credits eligibility, discovering model groups, and enabling the target SKU before using ai.createModel with streamText or generateText.

What's the best way to stream AI text generation responses in a Web SPA?

The best way to stream AI text generation in a Web SPA is using the streamText function for incremental token delivery, after confirming Token Credits eligibility and ensuring the exact model SKU is enabled in the cloudbase group.

Why does my CloudBase AI model call fail with a model not found error in my Next.js app?

AI model calls fail when preflight steps are skipped. You must run DescribeEnvPostpayPackage for Token Credits eligibility, DescribeAIModels for discovery, DescribeManagedAIModelList for catalog verification, and UpdateAIModel for enablement before generation.

Do I need a Node.js proxy to use CloudBase AI models in an admin dashboard?

No, you do not need a Node.js proxy to use CloudBase AI models in an admin dashboard. This browser-first approach supports calling AI models directly from the frontend without proposing a proxy first.

Can I get non-streaming single responses from AI models in a Nuxt application?

Yes, you can get non-streaming single responses from AI models in a Nuxt application by using the generateText function, provided you have confirmed Token Credits eligibility and enabled the exact model SKU in the cloudbase group.