ai-model-nodejs
Skill by LeoYeAI
Calls AI models from Node.js backends and CloudBase cloud functions using @cloudbase/node-sdk. It covers text generation, streaming text, and image generation with Hunyuan and DeepSeek models. It is for backend and serverless developers.
Install ai-model-nodejs
Built from the published package, never by AI.
git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills /tmp/openclaw-master-skills && mkdir -p ~/.claude/skills && cp -r /tmp/openclaw-master-skills/skills/cloudbase/references/ai-model-nodejs ~/.claude/skills/ai-model-nodejsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/LeoYeAI/openclaw-master-skills /tmp/openclaw-master-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/openclaw-master-skills/skills/cloudbase/references/ai-model-nodejs ~/.gemini/antigravity-cli/skills/ai-model-nodejsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill guides developers who build Node.js backend services or CloudBase cloud functions that need AI features. It uses the @cloudbase/node-sdk package, version 3.16.0 or above, and covers three calls: generateText for non-streaming text, streamText for streamed output, and generateImage for images. The source lists built-in providers hunyuan-exp and deepseek, with hunyuan-2.0-instruct-20251111 and deepseek-v3.2 as recommended models, and hunyuan-image for image generation.
The skill also explains setup. It shows how to initialize the SDK inside a cloud function or on a regular Node.js server using an environment ID and credentials. It recommends longer cloud function timeouts for AI operations, with 900 seconds for image generation. It is meant for backend and serverless work such as Express, Koa, NestJS, and CloudBase cloud functions. Browser apps and WeChat Mini Programs are directed to other skills.
Written from the project's SKILL.md and checked against it.
What it can do
- generateTextGenerates a non-streaming text response from a chosen model, with token usage and message history.
- streamTextStreams model output as incremental text chunks or full data chunks.
- generateImageCreates images with the hunyuan-image model and returns image URLs and revised prompts.
- Built-in model providersOffers hunyuan-exp and deepseek providers with several named models.
- Cloud function timeout guidanceRecommends timeout values for text, streaming, and image generation operations.
What you need
- @cloudbase/node-sdk version 3.16.0 or above
- A CloudBase environment ID
- SecretId and SecretKey when running on a regular Node.js server
Try asking
- Add a streaming AI chat endpoint to my Express backend using CloudBase.
- Write a cloud function that generates an image with hunyuan-image.
- Call deepseek-v3.2 from a Node.js service and return the generated text.
Good to know
- Image generation is only available in the Node SDK, not the JS SDK for Web or WeChat Mini Programs.
- Generated image URLs are valid for 24 hours.
- The AI feature requires @cloudbase/node-sdk version 3.16.0 or above.
- Not for browser apps or WeChat Mini Programs.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/cloudbase/references/ai-model-nodejs/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB
Alternatives to ai-model-nodejs
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
ai-model-nodejs: common questions
Which AI models does this skill support?
The skill lists hunyuan-exp models such as hunyuan-2.0-instruct-20251111 and deepseek models such as deepseek-v3.2. It recommends hunyuan-2.0-instruct-20251111 and deepseek-v3.2 respectively.
Can it generate images?
Yes. The skill covers generateImage with the hunyuan-image model. The source says this is the only SDK that supports image generation.
Is this skill for browser or mini program apps?
No. The source says browser and Web apps should use the ai-model-web skill, and WeChat Mini Programs should use the ai-model-wechat skill.
How do I install ai-model-nodejs?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is ai-model-nodejs free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is ai-model-nodejs safe to use?
It scores 85 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to ai-model-nodejs?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
