一键导入
ais-llm
Tích hợp LLM production — chat, streaming SSE, function calling, cost tracking, retry, fallback. Không memory leak, tự động reconnect.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Tích hợp LLM production — chat, streaming SSE, function calling, cost tracking, retry, fallback. Không memory leak, tự động reconnect.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience.
Game art principles — art style, color theory, animation principles, asset pipeline
Game design principles — core loop, GDD, player psychology, difficulty balancing, progression
Orchestrator game — route to implementation skill (pxhopencode) + principle-based sub-skill (agent-skills-hub)
Mobile game principles — touch input, battery, thermal, app stores, monetization
Multiplayer game principles — networking architecture, synchronization, security, matchmaking
| name | ais-llm |
| description | Tích hợp LLM production — chat, streaming SSE, function calling, cost tracking, retry, fallback. Không memory leak, tự động reconnect. |
Every LLM call must have retry, fallback, and cost guard. No naked API calls.
KHÔNG BAO GIỜ gọi LLM mà KHÔNG có retry + cost guard
Streaming là mặc định cho mọi chat UX
| File | Mục đích |
|---|---|
templates/chat.py | chat() with retry (exp backoff 1→2→4s), LLMResponse dataclass |
templates/streaming.py | SSE streaming endpoint (FastAPI StreamingResponse) |
templates/function-calling.py | Tool call parsing with Pydantic validation, parse_tool_call() |
templates/cost-tracker.py | CostTracker with daily budget, can_call() guard |
from templates.chat import chat, LLMResponse
resp = await chat([{"role": "user", "content": "hello"}])
Security:
client.api_keyOPENAI_API_KEY via env, never hardcodedaily_budget in CostTracker to prevent bill shock| Excuse | Reality |
|---|---|
| "Retry không cần, API luôn ổn" | OpenAI rate limit 429, network timeout thường xuyên |
| "Streaming phức tạp, dùng chat luôn" | UX chậm, user thấy loading lâu |
| "Cost tracker sau" | Bill $1000 bất ngờ vì infinite retry loop |