|
| 1 | +# Models |
| 2 | + |
| 3 | +Datafast supports multiple LLM providers through a unified interface. Since model evolve fast, it is not uncommon for things to break. |
| 4 | +Please find below a list of my favoriate models to use in `datafast` for each LLMProvider which provide a balance of cost, performance and stability. |
| 5 | + |
| 6 | +See [LLM Providers](llms.md) for more details about supported arguments for each provider. |
| 7 | + |
| 8 | +## Recommended Models by Provider |
| 9 | + |
| 10 | +### OpenAI |
| 11 | + |
| 12 | +**Default**: `gpt-5-mini-2025-08-07` |
| 13 | + |
| 14 | +**Recommended Models**: |
| 15 | + |
| 16 | +- **gpt-5-2025-08-07** - Most intelligent, capable, but also expensive. Only use for the most complex tasks. |
| 17 | + *Pricing: \$1.25/\$10 per million I/O token* |
| 18 | + |
| 19 | +- **gpt-5-mini-2025-08-07** - Intelligent, capable, and affordable. |
| 20 | + *Pricing: \$0.25/\$2 per million I/O token* |
| 21 | + |
| 22 | +- **gpt-5-nano-2025-08-07** - Tiny and cheap. Only use for simple tasks or testing. |
| 23 | + *Pricing: \$0.05/\$0.4 per million I/O token* |
| 24 | + |
| 25 | +```python |
| 26 | +from datafast.llms import OpenAIProvider |
| 27 | + |
| 28 | +# Using default model |
| 29 | +llm = OpenAIProvider() |
| 30 | + |
| 31 | +# Using a specific model |
| 32 | +llm = OpenAIProvider(model_id="gpt-5-2025-08-07") |
| 33 | +``` |
| 34 | + |
| 35 | +### Anthropic |
| 36 | + |
| 37 | +**Default**: `claude-haiku-4-5-20251001` |
| 38 | + |
| 39 | +**Recommended Models**: |
| 40 | + |
| 41 | +- **claude-haiku-4-5-20251001** - Fast, efficient for most tasks. |
| 42 | + *Pricing: \$1/\$5 per million I/O token* |
| 43 | + |
| 44 | +- **claude-sonnet-4-5-20250929** - Most powerful model, but also most expensive. |
| 45 | + *Pricing: \$3/\$15 per million I/O token* |
| 46 | + |
| 47 | +```python |
| 48 | +from datafast.llms import AnthropicProvider |
| 49 | + |
| 50 | +# Using default model |
| 51 | +llm = AnthropicProvider() |
| 52 | + |
| 53 | +# Using a specific model |
| 54 | +llm = AnthropicProvider(model_id="claude-sonnet-4-5-20251001") |
| 55 | +``` |
| 56 | + |
| 57 | +### Google Gemini |
| 58 | + |
| 59 | +**Recommended and default**: `gemini-2.5-flash-lite` |
| 60 | + |
| 61 | +```python |
| 62 | +from datafast.llms import GeminiProvider |
| 63 | + |
| 64 | +# Using default model |
| 65 | +llm = GeminiProvider() |
| 66 | + |
| 67 | +# Using a specific model |
| 68 | +llm = GeminiProvider(model_id="gemini-2.5-flash-lite") |
| 69 | +``` |
| 70 | + |
| 71 | +### Ollama (Local Models) |
| 72 | + |
| 73 | +**Recommended**: `gemma3:27b-it-qat` |
| 74 | + |
| 75 | +Fast, capable, reliable, and does not take up too much vRAM. |
| 76 | + |
| 77 | +```python |
| 78 | +from datafast.llms import OllamaProvider |
| 79 | + |
| 80 | +# Using recommended model |
| 81 | +llm = OllamaProvider(model_id="gemma3:27b-it-qat") |
| 82 | + |
| 83 | +# Custom API endpoint |
| 84 | +llm = OllamaProvider( |
| 85 | + model_id="gemma3:27b-it-qat", |
| 86 | + api_base="http://localhost:11434" |
| 87 | +) |
| 88 | +``` |
| 89 | + |
| 90 | +### OpenRouter |
| 91 | + |
| 92 | +There are many models available on OpenRouter, but here are some of our favorites: |
| 93 | + |
| 94 | +- **qwen/qwen3-next-80b-a3b-instruct** - High capability |
| 95 | +- **deepseek/deepseek-r1-0528** - Strong reasoning, cost-effective |
| 96 | +- **z-ai/glm-4.6** - Balanced performance |
| 97 | +- **meta-llama/llama-3.3-70b-instruct** - Versatile, open-source |
| 98 | + |
| 99 | +```python |
| 100 | +from datafast.llms import OpenRouterProvider |
| 101 | + |
| 102 | +# Using a specific model |
| 103 | +llm = OpenRouterProvider(model_id="deepseek/deepseek-r1-0528") |
| 104 | + |
| 105 | +# Another example |
| 106 | +llm = OpenRouterProvider(model_id="qwen/qwen3-next-80b-a3b-instruct") |
| 107 | +``` |
| 108 | + |
| 109 | +!!! warning |
| 110 | + Avoid using `gpt-oss:20b` or `gpt-oss:120b` as they do not work well with structured output. |
| 111 | + |
| 112 | +## More Details |
| 113 | + |
| 114 | +For comprehensive information about LLM providers, API keys, generation methods, and advanced usage, see the [LLM Providers](llms.md) page. |
0 commit comments