ai-model-nodejs

Access AI models from Node.js backends and CloudBase functions via @cloudbase/node-sdk.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/l395624064/plantCard_Demo01 --skill ai-model-nodejs-l395624064
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-model-nodejs
Source: https://github.com/l395624064/plantCard_Demo01/tree/main/.trae/skills/cloudbase/references/ai-model-nodejs
Command: npx skills add https://github.com/l395624064/plantCard_Demo01 --skill ai-model-nodejs-l395624064

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Node.js backends and CloudBase functions often need to integrate AI capabilities (text generation, streaming responses, and image generation) but lack a ready-to-use server-side solution. This skill provides a clear pattern for using the CloudBase Node SDK to perform AI operations securely from backend services.

Core Features & Use Cases

  • Text generation (generateText) with structured prompts.
  • Streaming (streamText) for real-time outputs.
  • Image generation (generateImage) using Hunyuan image models within Node.js/Cloud Functions.
  • Use Case: Build an API that answers user questions and returns an image illustrating results.

Quick Start

Install @cloudbase/node-sdk, initialize the AI client in your Cloud Function or Node.js server, and call generateText with a user prompt.

Frequently Asked Questions about ai-model-nodejs

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

FAQPage Schema
How do I run text generation and streaming responses in a Node.js backend?

To run text generation and streaming in a Node.js backend, use the @cloudbase/node-sdk to initialize the AI client and call generateText or streamText with structured prompts. This provides secure server-side access to models like deepseek-v3.2.

Can I generate images using AI models within CloudBase functions?

Yes, you can generate images within CloudBase functions by using the generateImage function from the @cloudbase/node-sdk. It directly integrates Hunyuan image models to produce visual outputs securely from your backend service.

What version of @cloudbase/node-sdk is required for server-side AI tasks?

Server-side AI tasks require @cloudbase/node-sdk version 3.16.0 or newer. This version provides the necessary AI client initialization and supports generateText, streamText, and generateImage operations for Node.js backends.

Does the @cloudbase/node-sdk support streaming text outputs for real-time applications?

Yes, the @cloudbase/node-sdk supports streaming text outputs through the streamText function. This enables real-time AI responses in Node.js backends, allowing applications to display text generation progressively as it is produced.

What is the best way to securely access AI models from a serverless backend?

The best way to securely access AI models from a serverless backend is using the @cloudbase/node-sdk. It enables Node.js and CloudBase functions to perform text and image generation securely without exposing API keys directly to the client side.

Which AI models are available for text generation in Node.js backends using CloudBase?

Available AI models for text generation in Node.js backends using CloudBase include hunyuan-2.0-instruct-20251111 and deepseek-v3.2. These models are accessed via the generateText and streamText functions in the @cloudbase/node-sdk.