コーディング エージェントにモデルを選ばせましょう。
カードに合うモデルを選ぶということは、量子化、エンジン (vLLM か llama.cpp か)、GPU 間での分割方法、与えるコンテキストの量、KV キャッシュの型、投機的デコードが効くかどうかを選ぶということです。推測するたびにダウンロードと読み込みが一回ずつかかります。コンソールが行うことはすべて API 呼び出しなので、ほかの作業をしている間にコーディング エージェントがこの探索を代わりに行えます。
三つの手順でセットアップ
- GPU ホストに LM Warden をインストールし (コマンドはダウンロードとインストールにあります)、セットアップ ウィザードを完了します。
- Settings → Access Tokens で、有効期限 30 日の管理者トークンを発行します。エージェントが使うシェルで、それを
VW_ADMIN_TOKEN、warden のアドレスをWとしてエクスポートします。 - エージェントを起動します。Claude Code、Codex CLI など、シェル コマンドを実行できるエージェントを使います。この作業にはホストされたモデルを使ってもかまいません。チューニングの対象は、カード上のモデルです。
エージェントが使うもの
| 手順 | エンドポイント |
|---|---|
| カードを確認する | GET /api/system/gpus |
| ダウンロード前にモデルが収まるか確認する | POST /api/models/fit-preview |
| 登録し、初期設定を得る | POST /api/models, GET /api/models/{model_id}/suggest-config |
| 取得して読み込む | POST /api/models/{model_id}/pull, POST /api/models/{model_id}/load |
| 実際のコンテキスト上限を測定する | POST /api/models/{model_id}/stress、続いて POST /api/models/{model_id}/stress/apply |
| warden の数値を読む | GET /api/stats/v2/throughput, GET /api/stats/v2/latency |
| テスト トラフィックを送る | POST /api/tokens で得た推論用キーで /v1/chat/completions に |
エージェントは最初にエージェント ガイドを読みます。言語モデル向けに書かれた、これらの呼び出しと避けるべき誤りの短い説明です。
貼り付けるプロンプト
https://your-warden を warden のアドレスに、大文字の名前を検討中のモデルに置き換えてください。
1. ハードウェアを調べてモデルを絞り込む
Read https://your-warden/agent-guide.md and follow it. My admin token is in $VW_ADMIN_TOKEN and the warden is at $W. List the GPUs this warden may use. Then shortlist three open-weight models from Hugging Face that fit them, for agentic coding with tool calling. Check each with POST /api/models/fit-preview and keep only those that fit with at least 65536 tokens of context. Show me a table: model, quantisation, engine, GPUs, context, and why. Do not download anything yet.
2. 一つのモデルのエンジンとレイアウトを選ぶ
Read https://your-warden/agent-guide.md and follow it. Credentials are in $VW_ADMIN_TOKEN and $W. For the model MODEL_REPO, decide between vLLM and llama.cpp, and between tensor parallel and data parallel replicas on my GPUs. Use fit-preview for every layout you consider. Register and load the best two layouts one after the other, send each the same 20 streaming requests through an inference key you issue, and compare time to first token and tokens per second at concurrency 1 and 8. Keep the winner loaded, unload the other, revoke the key, and report the numbers.
3. 実際の限界を見つけて適用する
Read https://your-warden/agent-guide.md and follow it. Credentials are in $VW_ADMIN_TOKEN and $W. The loaded model is MODEL_NAME. Nobody else is using this warden right now. Run a quick stress run on it, wait for it to finish, read its capabilities and apply the measured context. Then benchmark it at concurrency 1, 4 and 16 with prompts of about 2k and 30k tokens, and give me a table of time to first token and tokens per second.
4. 自分のワークロードで二つの候補を比較する
Read https://your-warden/agent-guide.md and follow it. Credentials are in $VW_ADMIN_TOKEN and $W. Compare MODEL_A and MODEL_B for my workload: the prompts in ./workload/*.txt. Load each in turn with its best layout, replay the prompts at concurrency 4, and record latency, tokens per second, and whether each answer is correct by your judgement. Write the results to ./model-comparison.md with a recommendation, and leave the recommended model loaded.
始める前に
- 管理者トークンは、モデル、キー、設定を含め、warden に対する完全な管理者権限を持ちます。より狭いスコープはまだありません。有効期限は短くしてください。
- ストレス テストは、限界を見つけるためにわざとエンジンをクラッシュさせます。これらのプロンプトは、ほかの誰も頼っていない warden で実行してください。
- ダウンロードは大容量です。プロンプトは取得前に収まるかを確認するようエージェントに求めますが、ディスクには注意してください。
- 作業が終わったら、Settings → Access Tokens で管理者トークンを失効させてください。