# LLM

Implement large language model (LLM) chat completions using the z-ai-web-dev-sdk.

- Repository: https://github.com/jjyaoao/HelloAgents (3333 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-10-06
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add jjyaoao/HelloAgents --skill LLM -g -a claude-code -y`
Codex: `npx skills add jjyaoao/HelloAgents --skill LLM -g -a codex -y`
Cursor: `npx skills add jjyaoao/HelloAgents --skill LLM -g -a cursor -y`
Gemini CLI: `npx skills add jjyaoao/HelloAgents --skill LLM -g -a gemini-cli -y`

## Description

Implement large language model (LLM) chat completions using the z-ai-web-dev-sdk. Use this skill when the user needs to build conversational AI applications, chatbots, AI assistants, or any text generation features. Supports multi-turn conversations, system prompts, and context management.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# LLM (Large Language Model) Skill

This skill guides the implementation of chat completions functionality using the z-ai-web-dev-sdk package, enabling powerful conversational AI and text generation capabilities.

## Skills Path

**Skill Location**: `{project_path}/skills/llm`

this skill is located at above path in your project.

**Reference Scripts**: Example test scripts are available in the `{Skill Location}/scripts/` directory for quick testing and reference. See `{Skill Location}/scripts/chat.ts` for a working example.

## Overview

The LLM skill allows you to build applications that leverage large language models for natural language understanding and generation, including chatbots, AI assistants, content generation, and more.

**IMPORTANT**: z-ai-web-dev-sdk MUST be used in backend code only. Never use it in client-side code.

## Prerequisites

The z-ai-web-dev-sdk package is already installed. Import it as shown in the examples below.

## CLI Usage (For Simple Tasks)

For simple, one-off chat completions, you can use the z-ai CLI instead of writing code. This is ideal for quick tests, simple queries, or automation scripts.

### Basic Chat

```bash
# Simple question
z-ai chat --prompt "What is the capital of France?"

# Save response to file
z-ai chat -p "Explain quantum computing" -o response.json

# Stream the response
z-ai chat -p "Write a short poem" --stream
```

### With System Prompt

```bash
# Custom system prompt for specific behavior
z-ai chat \
  --prompt "Review this code: function add(a,b) { return a+b; }" \
  --system "You are an expert code reviewer" \
  -o review.json
```

### With Thinking (Chain of Thought)

```bash
# Enable thinking for complex reasoning
z-ai chat \
  --prompt "Solve this math problem: If a train travels 120km in 2 hours, what's its speed?" \
  --thinking \
  -o solution.json
```

### CLI Parameters

The rest: https://github.com/jjyaoao/HelloAgents/blob/HEAD/skills/LLM/SKILL.md
