Home

Field SOP

Scenario-based tutorials with real screenshots, prompts, workflow templates and pitfalls.

Migration SOP for Model Sunsets and Repricing: Four Steps to Inventory, Migrate, Recalculate, and Contain Cost

Three things happened at once on 2026-08-31: Sonnet 5 API rates moved from $2 and $10 to $3 and $15, GPT-5.4 and GPT-5.4 mini stopped being offered to Codex users signed in with ChatGPT, and kimi-k2.5 and moonshot-v1 sunset the same day. The three change types need completely different responses, yet most teams apply one uniform reaction and end up either overreacting or underreacting. This SOP runs four steps. Step zero classifies using keywords in the vendor announcement: sunset or deprecated means the ID stops responding, handle it today; replace or a default change means the entry point still works but the model behind it changed, so run a regression this week; pricing only means no interruption but a recalculation this month. Step one inventories every model ID in the codebase with a single grep, collapses them into one central config, and wires the check into CI. Step two executes the per-type migration. Step three recalculates monthly cost from three factors: tokenizer inflation, peak versus off-peak share, and cache hit rate. Also included: an eleven-item checklist, step four on limits, alerts and a fallback path, and seven ways this goes wrong, the most common being model IDs scattered through code where one fix misses three call sites.

Qwen3.8-Flash-Next Full-Stack Deployment SOP: 125B Main Model plus 51B N-gram Embeddings, Three Tiers from Hosted API to Apple Silicon

A three-tier route for taking Qwen3.8-Flash-Next from "it runs" to "it runs cheaply". The managed tier needs no ops: the QwenCloud API speaks both OpenAI and Anthropic specs, and QwenWork's Standard mode is powered by this model. For self-hosted serving, four commands quoted verbatim from the official README: transformers serve (--continuous-batching), SGLang (--tp-size 4 --context-length 262144 --reasoning-parser qwen3 --tool-call-parser qwen3_coder), vLLM (--tensor-parallel-size 4 --max-model-len 262144 --enable-auto-tool-choice) and TokenSpeed, all exposing an OpenAI-compatible API at localhost:8000/v1. Local and edge paths include GGUF builds via llama.cpp, mlx-vlm on Apple Silicon, and Unsloth. The engineering detail most worth remembering: the extra 51B of N-gram embeddings can be offloaded to host memory and overlapped with model compute through async prefetch. Because the README gives no official VRAM baseline, this SOP refuses to guess a hardware floor and marks it as "defer to the official recipe and your own measurements". Also covers the trade-offs of YaRN extrapolation to 1M, fine-tuning framework choices (Unsloth, Swift, Llama-Factory) and seven pitfalls - the first being that the GitHub repo ships no LICENSE file, so check the model page before commercial use.

Tencent 770B Flagship Self-Hosting SOP: Eight H100s Can't Even Fit the FP8 Weights - Official Baseline Is 16x B200

A complete SOP for self-hosting Tencent's 770B flagship Hy4 preview. Cold water first, via the VRAM math: FP8 weights run about 770GB, and the official vLLM recipe states the baseline is 16xB200 or 8xB300 (weights + KV cache) - 8xH100 (640GB) cannot even fit FP8 weights, since 49B active params save compute but all 770B weights must sit in VRAM. Both deployment routes quote the official README verbatim: the vLLM prebuilt image (MTP speculative decoding num_speculative_tokens=3, FLASHMLA_SPARSE attention backend, hy_v4 tool/reasoning parsers) and the SGLang prebuilt image (NEXTN speculation, tp-size 8). Includes OpenAI-compatible invocation (temperature 0.9 / top_p 1.0; no_think to skip deep reasoning and save output tokens), AngelSlim self-quantization, the finetune pipeline, 7 pitfalls and a 10-item launch checklist; if you skip self-hosting, use Tencent Cloud TokenHub/OpenRouter or the two-week free tier on WorkBuddy/CodeBuddy.

GLM-5.3-Flash Integration SOP: Three Routes From ¥0.8/M Tokens to 100,000 Domestic GPUs - Visual Coding Running in a Day

A complete SOP for integrating GLM-5.3-Flash from zero and getting visual coding running in a day, across three routes: direct API (first result in 10 minutes via one curl call; official recommended params temperature 1, top_p 0.95, reasoning_effort max; thinking only supports enabled, and stream/tool_stream must be turned on as a pair); GLM Coding Plan subscription (wire 20+ coding tools to GLM in half an hour, three tiers at 118/538/1,078 RMB with 3x quota); and self-hosting the open weights (vLLM/SGLang, VRAM figures are engineering estimates). The core deliverable is the Visual Coding screenshot feedback loop: after each render, pass the UI screenshot back as image_url so the model iterates on its own output. Includes a parameter acceptance checklist, per-type token accounting, and 5 field-tested pitfalls.

GPT-Image 2 Commercial Image SOP: From Structured Prompts to Cost Control, 1 to 15 Cents per Image

"How much does one AI poster cost?" now has a precise answer in the GPT-Image 2 era: $0.006-0.211 per image on the official API, half price on Batch. This SOP walks the full pipeline from requirement to deliverable: translating needs into tiers (Instant/Thinking, low/medium/high, 3:1-1:3 ratios, and the 2025-12 knowledge-cutoff web-access pitfall); structuring prompts (the five-block atomic method - subject/layout/style/text-lock/constraints - with explicit text locking against garbling); calling the API (curl and Python examples against /v1/images/generations, with token-billing conversion); choosing channels (official, half-price Batch, Azure 4K, per-image gateways in a cost table); batching with a five-point QA checklist; and seven field-tested pitfalls (diminishing edit returns, billed input images, never shipping the low tier). Includes the $30-120 budget band for 1,000 posters.

Wan3.0 Hands-On SOP: The Full Pipeline from PPT to a 30-Second Finished Video

On 2026-08-24 Alibaba Cloud Bailian launched Wan3.0-Video: first-ever direct PPT/PDF/Word document input, 2-30 second single generations across 480P/720P/1080P, API billed per second at 0.3/0.6/1.2 CNY. This SOP walks the full pipeline from document to 30-second finished film: Bailian keys and region consistency, the zero-code entry points, the DashScope SDK (>=1.25.16) with async polling and the 24-hour video_url window, a timestamped storyboard prompt template, and the file-or-link reference-video workflow - plus a cost table (1080P/30s at 36 CNY list, 25.2 CNY on the 30% promo, 60-80 CNY with gacha budget) and 7 pitfalls.

Freeload OpenAI's Top Agent Foundation: The Codex Harness Integration SOP - a Three-Stage Rocket from One Command to a Production Runtime

The integration SOP for freeloading OpenAI's top agent foundation: a three-stage rocket. Stage 0 authentication (login_chatgpt / login_api_key; keys in env vars, never prompts) -> Stage 1 codex exec, one command for CI/scripts -> Stage 2 the Codex SDK as a callable function (startThread/run, outputSchema structured output, thread persistence in ~/.codex/sessions with resumeThread breakpoint resume, runStreamed event streams, sandbox and filesystem-granularity permission config examples) -> Stage 3 codex app-server as a production runtime (JSON-RPC 2.0, generate-json-schema, first-class Approvals semantics, -32001 overload retry, /readyz /healthz probes). Includes a 10-item pre-launch checklist and five classic pitfalls (keys in prompts, trusting sandbox defaults, non-Git directories, re-running instead of resuming, jumping to app-server on day one). All examples from the official repo docs; not legal or security-compliance advice.

Agent Guardrails SOP: If OpenAI Got Burned, Where Is Your Permission Checklist?

A deployment SOP for putting reins on AI agents: even OpenAI just crashed (its Aug 18 slowdown announcement), so ordinary teams need engineered guardrails all the more. Five steps: a three-question risk tier (L1 read-only / L2 sandboxed writes / L3 production, money, or external systems) -> least-privilege credentials (keys in env vars never in prompts, scoped tokens with expiry, physical separation of production and agent credentials) -> the sandbox execution layer (selection conclusions from this batch's comparison: E2B for fastest launch, CubeSandbox for self-hosted out-of-the-box, agent-sandbox on K8s - with a minimal E2B example) -> monitoring and approval gates (full behavioral logs, human approval for high-risk actions, and the cheap-model-watches-expensive-model AI-monitor pattern) -> circuit breakers and incident response (dual token-and-action caps, auto-pause on anomalies, a four-column post-mortem template). Includes a 10-item pre-launch checklist and five classic pitfalls. Not legal advice.

Before You Hand Your AI Agent a Wallet: A Grounded SOP from Sandboxed Budgets to Real Payments, with Three Circuit Breakers

An SOP for wiring payments into AI agents: five steps - a three-question scope check (90% of needs stop at quotas) -> the sandbox layer (prepaid isolation, the QPS/daily/per-request cap trio, read-only payment tools, full logging; 7-day graceful-degradation gate) -> choose a rail (the stripe/ai official repo MCP path vs the x402-fetch npm package) -> hands-on integration (read-only-first MCP JSON config plus wrapFetchWithPayment code) -> three circuit breakers (limits / allowlist / human approval) and a launch checklist. Five pitfalls: credentials in prompts, capless launches, limits without allowlists, skipping the sandbox, and forgetting refunds and reconciliation. Not legal or investment advice.

Give Your AI Content a Legal ID Card: A Labeling Compliance SOP (Explicit + Implicit Labels, Hands-On)

An AI content labeling compliance SOP: four hands-on steps under the labeling Measures + GB 45438 - a three-question scope check -> explicit labels (per-content-type table + platform declaration toggles) -> implicit labels (full c2patool install / manifest.json trainedAlgorithmicMedia / embed-and-verify commands) -> publish and keep records. Five pitfalls: platform re-compression strips metadata / label-stripping tools are unlawful and ineffective / do not hide explicit labels / watermarks are just one implicit form / write labeling duties into outsourcing contracts. Not legal advice.