用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/majiayu000/claude-skill-registry --skill faion-ml-ops命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | faion-ml-ops |
| description | ML operations: fine-tuning (LoRA, QLoRA), model evaluation, cost optimization, observability. |
| user-invocable | false |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash, Task, AskUserQuestion, TodoWrite |
Entry point:
/faion-net— invoke this skill for automatic routing to the appropriate domain.
Communication: User's language. Code: English.
Handles ML model operations. Covers fine-tuning, evaluation, cost management, and observability.
Check these project signals before asking questions:
| Signal | Where to Check | What to Look For |
|---|---|---|
| Dependencies | requirements.txt | transformers, peft, openai, tiktoken, langsmith |
| Training data | /data, /datasets | JSONL files for fine-tuning |
| Logs/metrics | Grep for "langsmith", "wandb", "mlflow" | Existing observability tools |
| Cost tracking | Grep for "tiktoken", "count_tokens" | Token counting implementation |
question: "What ML operation are you working on?"
header: "Operation Type"
multiSelect: false
options:
- label: "Fine-tuning LLM"
description: "Custom model training (OpenAI API, LoRA, QLoRA)"
- label: "Model evaluation"
description: "Benchmark performance, LLM-as-judge"
- label: "Cost optimization"
description: "Reduce API costs, prompt caching, batching"
- label: "Observability/monitoring"
description: "Track LLM usage, traces, performance"
question: "For fine-tuning: dataset size and approach?"
header: "Fine-tuning Strategy"
multiSelect: false
options:
- label: "<100 examples - use few-shot prompting instead"
description: "Too small for fine-tuning, improve prompts"
- label: "100-1000 examples - OpenAI fine-tuning"
description: "Use OpenAI API fine-tuning endpoint"
- label: ">1000 examples - LoRA/QLoRA"
description: "Efficient parameter fine-tuning"
- label: "Not fine-tuning"
description: "Skip this question"
question: "Which observability tools?"
header: "Monitoring Stack"
multiSelect: true
options:
- label: "LangSmith (recommended)"
description: "LangChain native tracing"
- label: "Langfuse (open-source)"
description: "Self-hosted observability"
- label: "Custom logging"
description: "Build custom tracking"
- label: "None yet"
description: "Starting from scratch"
| Area | Coverage |
|---|---|
| Fine-tuning | LoRA, QLoRA, OpenAI fine-tuning, datasets |
| Evaluation | Metrics, benchmarks, frameworks |
| Cost Optimization | Token management, caching, batch APIs |
| Observability | LLM monitoring, tracing, logging |
| Task | Files |
|---|---|
| Fine-tune OpenAI | fine-tuning-openai-basics.md → fine-tuning-openai-production.md |
| Fine-tune LoRA | lora-qlora.md → finetuning-basics.md |
| Cost optimization | llm-cost-basics.md → cost-reduction-strategies.md |
| Evaluation | evaluation-metrics.md → evaluation-framework.md |
| Observability | llm-observability.md → llm-observability-stack-2026.md |
Fine-tuning (5):
Evaluation (3):
Cost Optimization (2):
Observability (5):
from openai import OpenAI
client = OpenAI()
# Upload training data
file = client.files.create(
file=open("training_data.jsonl", "rb"),
purpose="fine-tune"
)
# Create fine-tuning job
job = client.fine_tuning.jobs.create(
training_file=file.id,
model="gpt-4o-mini-2024-07-18",
hyperparameters={"n_epochs": 3}
)
# Monitor
while True:
job = client.fine_tuning.jobs.retrieve(job.id)
if job.status == "succeeded":
break
from peft import LoraConfig, get_peft_model
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3-8b")
lora_config = LoraConfig(
r=16,
lora_alpha=32,
target_modules=["q_proj", "v_proj"],
lora_dropout=0.1,
bias="none"
)
model = get_peft_model(model, lora_config)
import tiktoken
def count_tokens(text, model="gpt-4o"):
encoding = tiktoken.encoding_for_model(model)
return len(encoding.encode(text))
def estimate_cost(prompt, completion, model="gpt-4o"):
prompt_tokens = count_tokens(prompt, model)
completion_tokens = count_tokens(completion, model)
# GPT-4o pricing
prompt_cost = prompt_tokens * 0.000005
completion_cost = completion_tokens * 0.000015
return prompt_cost + completion_cost
from langsmith import traceable
@traceable
def rag_pipeline(query: str) -> str:
# Retrieval
docs = retrieve(query)
# Generation
response = generate(query, docs)
return response
| Scenario | Approach |
|---|---|
| Small dataset (<100 examples) | Few-shot prompting |
| Medium dataset (100-1000) | OpenAI fine-tuning |
| Large dataset (>1000) | LoRA/QLoRA |
| Custom behavior | Fine-tuning |
| New knowledge | RAG (not fine-tuning) |
| Strategy | Savings | Trade-off |
|---|---|---|
| Prompt caching | 90% on cached | Cold start cost |
| Batch API | 50% | 24h latency |
| Smaller models | 80%+ | Lower quality |
| Context pruning | Variable | May lose context |
| Output limits | Variable | Truncated responses |
| Framework | Use Case |
|---|---|
| LangSmith | Production monitoring, traces |
| Langfuse | Open-source observability |
| PromptLayer | Prompt versioning |
| Weights & Biases | Experiment tracking |
| Skill | Relationship |
|---|---|
| faion-llm-integration | Provides APIs to optimize |
| faion-rag-engineer | RAG evaluation |
| faion-devops-engineer | Model deployment |
ML Ops v1.0 | 15 methodologies