Skip to content
llmops-operations logo

LLMOps 設計・運用

llmops-operations

LLMアプリケーションの設計・運用・評価・最適化。プロンプト管理、RAG構築、ファインチューニング、評価パイプライン、コスト最適化、本番運用。「LLM」「プロンプト」「RAG」「ファインチューニング」「AI運用」「評価」に関する質問で使用。

SKILL.md

Full skill instructions

LLMOps 設計・運用

クイックスタート

LLMアプリケーション基本構成

from anthropic import Anthropic

client = Anthropic()

def chat(messages: list[dict], system: str = None) -> str:
    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=4096,
        system=system or "You are a helpful assistant.",
        messages=messages
    )
    return response.content[0].text

RAG基本パターン

from anthropic import Anthropic
import chromadb

# ベクトルDB初期化
chroma = chromadb.Client()
collection = chroma.get_or_create_collection("docs")

def rag_query(query: str, k: int = 5) -> str:
    # 関連ドキュメント検索
    results = collection.query(query_texts=[query], n_results=k)
    context = "\n\n".join(results["documents"][0])
    
    # LLMに回答生成
    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=4096,
        system="以下のコンテキストに基づいて質問に回答してください。",
        messages=[
            {"role": "user", "content": f"コンテキスト:\n{context}\n\n質問: {query}"}
        ]
    )
    return response.content[0].text

LLMOps原則

  1. 評価駆動: デプロイ前に必ず評価
  2. プロンプトバージョン管理: プロンプトをコードとして管理
  3. コスト監視: トークン使用量を常に監視
  4. フォールバック設計: モデル障害時の代替経路
  5. ガードレール: 入出力のバリデーション

詳細ガイド

ユーティリティスクリプト

# プロンプト評価実行
python scripts/​evaluate_prompts.py prompts/ test_cases.jsonl

# トークンコスト計算
python scripts/​estimate_cost.py --model claude-sonnet-4-20250514 --input-file data.jsonl

# RAGインデックス構築
python scripts/​build_index.py --docs ./​documents --output ./​index

ワークフロー: LLMアプリ構築

進捗チェックリスト:
- [ ] 1. ユースケース定義・要件整理
- [ ] 2. プロンプト設計・プロトタイピング
- [ ] 3. 評価データセット作成
- [ ] 4. 評価パイプライン構築
- [ ] 5. RAG/ツール統合(必要な場合)
- [ ] 6. ガードレール実装
- [ ] 7. 本番環境デプロイ
- [ ] 8. モニタリング設定

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View