Guides
New to AI? Start here: core concepts, tool setup, and advanced practice. Pick a doc from the left.
Concepts Beginner
What Is an LLM (Large Language Model)?
A plain-language explanation of how large language models work, what they can do, and where their limits are.
What is a large language model
An LLM (Large Language Model) is a kind of AI model trained on massive amounts of text. Its core ability is just one thing: predicting the most likely next word given the context. Yet from this simple mechanism, at sufficient scale of data and parameters, complex abilities emerge — understanding, reasoning, writing, and coding.
Think of an LLM as an assistant that has "read the entire human library": it does not truly understand the world, but it has learned the statistical patterns of language and the associations of world knowledge.
What it can do
- Text generation: writing, rewriting, translation, summarization
- Q&A: answering factual and conceptual questions
- Code: generating, explaining, and debugging code
- Reasoning: logic, math, and multi-step task decomposition
Where its limits are
LLMs are not omnipotent. Know their limits:
- Hallucination: they may fabricate plausible but wrong content
- Knowledge cutoff: they do not know events after their training data ends
- No true "understanding": statistical association, not human-like thinking
- Finite context: there is a cap on how much they can process at once
Mainstream models at a glance
Leading LLMs today include Anthropic's Claude series, OpenAI's GPT series, and DeepSeek's model family. When choosing, weigh four dimensions: capability, cost, context length, and availability in your region.
Beginner tipMaster one model and learn how to write prompts before comparing across models — it is far more efficient than juggling several at once.
What MCP is
MCP (Model Context Protocol) is an open protocol introduced by Anthropic. It defines a standard that lets AI models connect to external data sources and tools in a uniform way.
Think of it as the "USB port of the AI world" — any tool that follows the MCP standard can be plugged into any MCP-compatible AI and used immediately.
Why it is needed
Before MCP, integrating each tool required bespoke code — a one-to-one hard connection between model and tool. MCP standardizes this:
- Tool developers implement an MCP Server once
- AI apps (e.g. Claude Code, Cursor) connect through an MCP Client
- Adding a new tool requires no changes to the AI app itself
What it does
With MCP, AI goes beyond "just chatting" and gains real capabilities:
- Read/write files: operate on the local filesystem
- Query databases: run queries directly
- Call APIs: access third-party services
- Drive a browser: automate web tasks
Popular MCP servers
The community has published many ready-made MCP servers covering filesystems, Git, databases, browsers, and cloud services. In MCP-compatible clients you usually enable them via a config file.
Getting startedEnable an official filesystem MCP server first, experience "the AI can read my files", then expand step by step.
What a token is
A token is the smallest unit of text an LLM processes. It is not strictly a character or a word, but a fragment produced by the model's tokenizer. Rough estimates:
- English: 1 token ≈ 0.75 words
- Chinese: 1 token ≈ 0.5–1 characters
Both input and output are metered in tokens, which directly determines your API bill.
The context window
The context window is the maximum number of tokens a model can "see" at once, including your input and its output. Anything beyond the window is "forgotten".
This is why models lose track of earlier messages in long conversations — not carelessness, just a full window.
How billing works
APIs are usually billed per token, with input and output priced separately (output is typically more expensive). Roughly:
cost = inputTokens × inputPrice + outputTokens × outputPrice
How to control cost
- Trim prompts: remove redundancy, keep only necessary instructions
- Manage context: summarize or clear irrelevant history in long chats
- Cap output length: explicitly ask for concise answers
- Pick the right model: use cheaper small models for simple tasks
Practical trickTurn repeated long instructions into a skill or system prompt — it significantly cuts input tokens per call.
Prerequisites
Before you start, make sure you have:
- OS: macOS / Linux / Windows (WSL)
- Node.js installed (v18 or newer recommended)
- A working model API key
Installation
Install the Codex CLI globally via npm:
npm install -g @openai/codex
Then verify the installation:
codex --version
Configure the model
Codex supports official or third-party models. Edit the config file with your API key and model endpoint:
model = "gpt-5"
api_key = "your API key"
Verify it works
Enter a project directory and run a simple instruction:
codex "show me the structure of this directory"
If it responds normally, your setup is complete.
Network issuesConnection timeouts usually mean the terminal proxy is not configured — see the troubleshooting steps in "Claude Code Setup & Terminal Proxy".
Install Claude Code
Install Claude Code via npm:
npm install -g @anthropic-ai/claude-code
Terminal proxy configuration
Many people get stuck at step one with "API Connection Refused" or timeouts — usually because the terminal is not going through the proxy. Set the environment variables:
export https_proxy=http://127.0.0.1:7890
export http_proxy=http://127.0.0.1:7890
export all_proxy=socks5://127.0.0.1:7890
Replace the port with your local proxy tool's actual port.
Make it permanent
Add the export commands above to your shell profile (e.g. ~/.zshrc or ~/.bashrc), then run source ~/.zshrc to make them permanent.
Troubleshooting
- Timeouts: confirm the proxy tool is running and the port is correct
- 403 errors: usually a flagged high-risk IP — switch to a clean node
- Config not taking effect: check whether you opened a new terminal and sourced the profile
Debug orderCheck in this order: connection → proxy → environment variables → permissions. It beats reinstalling repeatedly.
What a skill is
A skill is a structured, reusable set of prompts and instructions. It codifies "how to do a certain kind of task" so the AI produces high-quality results reliably in that scenario. Writing a skill is essentially teaching your experience to the AI.
Anatomy of a skill
A typical skill contains:
- Name & description: tells the AI when to use it
- Role: defines the AI's identity for the task
- Procedure: a clear processing workflow
- Output format: the required structure of results
- Boundaries: what it must not do
Write your first skill
Follow the principle of "explicit, specific, verifiable". Take weekly-report drafting as an example:
# Role
You are a project-manager assistant skilled at upward communication.
# Task
Turn my work log into a decision-oriented weekly report.
# Output format
1. One-sentence conclusion
2. Key progress
3. Risks and support needed
4. Next week's priorities
Debug and iterate
Good skills are iterated, not written in one pass:
- Test with real cases and observe output deviations
- Add constraints or examples where it deviates
- Delete redundant instructions that have no effect
- Record the reason for each change, forming versions
Key insightVague adjectives ("make it better") barely work. Real examples and hard constraints are where quality comes from.