Chapter 3: Open Source Models
Why Open Source?β
- Privacy: Run locally, data never leaves your system
- Cost: No per-token API fees
- Customization: Fine-tune for specific use cases
- Control: No external dependencies
Popular Open Source Modelsβ
| Model | Creator | Sizes | Strengths |
|---|---|---|---|
| Llama 3 | Meta | 8B, 70B | General purpose, well-documented |
| Mistral | Mistral AI | 7B | Efficient, strong performance |
| Mixtral | Mistral AI | 8x7B | Mixture of experts, versatile |
| Phi-2/3 | Microsoft | 2.7B-3.8B | Small but capable |
Prompting Differencesβ
Open-source models may require:
- Specific prompt formats (e.g.,
[INST]...[/INST]for Llama) - Adjusted expectations for smaller models
- More explicit instructions
Llama Format Exampleβ
[INST] You are a helpful assistant.
Write a haiku about programming. [/INST]
Deployment Optionsβ
- Ollama: Easy local deployment
- vLLM: Production-ready serving
- Hugging Face: Cloud or local with transformers
- llama.cpp: Efficient CPU inference
Key Takeawaysβ
Summary
- Open source = privacy, cost savings, control
- Different models need different prompt formats
- Smaller models need clearer instructions
- Choose deployment method based on scale