الفصل 2: الفروقات عن MLOps التقليدية
مقارنة بين MLOps وLLMOps
| الجانب | MLOps التقليدية | LLMOps |
|---|---|---|
| حجم النموذج | MB إلى GB | GB إلى TB |
| التدريب | إعادة تدريب متكررة | الضبط الدقيق أو الموجّهات |
| المدخلات | ميزات منظمة | لغة طبيعية |
| المخرجات | درجات/فئات | نص مولّد |
| التقييم | مقاييس (AUC، F1) | الجودة، السلامة، الملاءمة |
| الكمون | ms | ثوانٍ |
| محرك التكلفة | الحوسبة | الرموز |
تحديات LLMOps الفريدة
1. هندسة الموجّهات
لا تحتوي ML التقليدية على "موجّهات" - تتطلب LLMs تصميم موجّهات بعناية:
# موجّه بسيط
prompt_v1 = "Summarize this document: {document}"
# موجّه محسّن مع قيود
prompt_v2 = """You are a professional summarizer.
Summarize the following document in 3 bullet points.
Keep each point under 20 words.
Focus on key facts and figures.
Document: {document}
Summary:"""
2. المخرجات غير الحتمية
# نفس المدخلات، مخرجات مختلفة
for i in range(3):
response = llm.generate("Write a haiku about Python")
print(f"Attempt {i+1}: {response}")
# المخرجات تختلف في كل مرة!
3. التسعير القائم على الرموز
def calculate_cost(input_tokens: int, output_tokens: int, model: str):
pricing = {
"gpt-4": {"input": 0.03, "output": 0.06},
"gpt-3.5-turbo": {"input": 0.0005, "output": 0.0015},
"claude-3-opus": {"input": 0.015, "output": 0.075},
}
input_cost = (input_tokens / 1000) * pricing[model]["input"]
output_cost = (output_tokens / 1000) * pricing[model]["output"]
return input_cost + output_cost
التالي: الفصل 3: تحديات خاصة بـ LLM