إنتقل إلى المحتوى الرئيسي

الفصل 2: الفروقات عن MLOps التقليدية

مقارنة بين MLOps وLLMOps​

الجانبMLOps التقليديةLLMOps
حجم النموذجMB إلى GBGB إلى 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