xiaohongshu
xiaohongshu
faion-ml-ops
ML operations: fine-tuning (LoRA, QLoRA), model evaluation, cost optimization, observability.
Full skill instructions
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
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience