aia 0.9.11 → 0.9.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.version +1 -1
- data/CHANGELOG.md +66 -2
- data/README.md +133 -4
- data/docs/advanced-prompting.md +721 -0
- data/docs/cli-reference.md +582 -0
- data/docs/configuration.md +347 -0
- data/docs/contributing.md +332 -0
- data/docs/directives-reference.md +490 -0
- data/docs/examples/index.md +277 -0
- data/docs/examples/mcp/index.md +479 -0
- data/docs/examples/prompts/analysis/index.md +78 -0
- data/docs/examples/prompts/automation/index.md +108 -0
- data/docs/examples/prompts/development/index.md +125 -0
- data/docs/examples/prompts/index.md +333 -0
- data/docs/examples/prompts/learning/index.md +127 -0
- data/docs/examples/prompts/writing/index.md +62 -0
- data/docs/examples/tools/index.md +292 -0
- data/docs/faq.md +414 -0
- data/docs/guides/available-models.md +366 -0
- data/docs/guides/basic-usage.md +477 -0
- data/docs/guides/chat.md +474 -0
- data/docs/guides/executable-prompts.md +417 -0
- data/docs/guides/first-prompt.md +454 -0
- data/docs/guides/getting-started.md +455 -0
- data/docs/guides/image-generation.md +507 -0
- data/docs/guides/index.md +46 -0
- data/docs/guides/models.md +507 -0
- data/docs/guides/tools.md +856 -0
- data/docs/index.md +173 -0
- data/docs/installation.md +238 -0
- data/docs/mcp-integration.md +612 -0
- data/docs/prompt_management.md +579 -0
- data/docs/security.md +629 -0
- data/docs/tools-and-mcp-examples.md +1186 -0
- data/docs/workflows-and-pipelines.md +563 -0
- data/examples/tools/mcp/github_mcp_server.json +11 -0
- data/examples/tools/mcp/imcp.json +7 -0
- data/lib/aia/chat_processor_service.rb +19 -3
- data/lib/aia/config/base.rb +224 -0
- data/lib/aia/config/cli_parser.rb +409 -0
- data/lib/aia/config/defaults.rb +88 -0
- data/lib/aia/config/file_loader.rb +131 -0
- data/lib/aia/config/validator.rb +184 -0
- data/lib/aia/config.rb +10 -860
- data/lib/aia/directive_processor.rb +27 -372
- data/lib/aia/directives/configuration.rb +114 -0
- data/lib/aia/directives/execution.rb +37 -0
- data/lib/aia/directives/models.rb +178 -0
- data/lib/aia/directives/registry.rb +120 -0
- data/lib/aia/directives/utility.rb +70 -0
- data/lib/aia/directives/web_and_file.rb +71 -0
- data/lib/aia/prompt_handler.rb +23 -3
- data/lib/aia/ruby_llm_adapter.rb +307 -128
- data/lib/aia/session.rb +27 -14
- data/lib/aia/utility.rb +12 -8
- data/lib/aia.rb +11 -2
- data/lib/extensions/ruby_llm/.irbrc +56 -0
- data/mkdocs.yml +165 -0
- metadata +77 -20
- /data/{images → docs/assets/images}/aia.png +0 -0
@@ -0,0 +1,366 @@
|
|
1
|
+
# Available Models
|
2
|
+
|
3
|
+
AIA supports a wide range of AI models through the RubyLLM gem. This comprehensive list shows all supported models, their capabilities, and best use cases.
|
4
|
+
|
5
|
+
## Viewing Available Models
|
6
|
+
|
7
|
+
### Command Line Query
|
8
|
+
```bash
|
9
|
+
# List all available models
|
10
|
+
aia --available_models
|
11
|
+
|
12
|
+
# Filter by provider
|
13
|
+
aia --available_models openai
|
14
|
+
aia --available_models anthropic
|
15
|
+
aia --available_models google
|
16
|
+
|
17
|
+
# Filter by capability
|
18
|
+
aia --available_models vision
|
19
|
+
aia --available_models function_calling
|
20
|
+
aia --available_models text_to_image
|
21
|
+
|
22
|
+
# Complex filtering (AND operation)
|
23
|
+
aia --available_models openai,gpt,4
|
24
|
+
aia --available_models anthropic,claude,sonnet
|
25
|
+
```
|
26
|
+
|
27
|
+
### Within Prompts
|
28
|
+
```markdown
|
29
|
+
# List models in a prompt
|
30
|
+
//available_models
|
31
|
+
|
32
|
+
# Filter models
|
33
|
+
//available_models openai,gpt
|
34
|
+
```
|
35
|
+
|
36
|
+
## Model Categories
|
37
|
+
|
38
|
+
### OpenAI Models
|
39
|
+
|
40
|
+
#### GPT-4 Family
|
41
|
+
- **gpt-4**: Most capable model, excellent for complex reasoning
|
42
|
+
- Context: 8,192 tokens
|
43
|
+
- Best for: Complex analysis, creative writing, code generation
|
44
|
+
- Cost: Higher, but highest quality
|
45
|
+
|
46
|
+
- **gpt-4-turbo**: Faster GPT-4 with larger context
|
47
|
+
- Context: 128,000 tokens
|
48
|
+
- Best for: Long documents, comprehensive analysis
|
49
|
+
- Cost: Lower than GPT-4, faster responses
|
50
|
+
|
51
|
+
- **gpt-4-vision-preview**: GPT-4 with image understanding
|
52
|
+
- Context: 128,000 tokens (including images)
|
53
|
+
- Best for: Image analysis, visual content creation
|
54
|
+
- Capabilities: Text + image input, text output
|
55
|
+
|
56
|
+
#### GPT-3.5 Family
|
57
|
+
- **gpt-3.5-turbo**: Fast, cost-effective general purpose
|
58
|
+
- Context: 4,096 tokens
|
59
|
+
- Best for: General queries, quick tasks, batch processing
|
60
|
+
- Cost: Most economical
|
61
|
+
|
62
|
+
- **gpt-3.5-turbo-16k**: Extended context version
|
63
|
+
- Context: 16,384 tokens
|
64
|
+
- Best for: Longer documents, extended conversations
|
65
|
+
- Cost: Moderate
|
66
|
+
|
67
|
+
#### Specialized OpenAI Models
|
68
|
+
- **text-davinci-003**: Legacy completion model
|
69
|
+
- **code-davinci-002**: Code-optimized model
|
70
|
+
- **text-embedding-ada-002**: Text embedding model
|
71
|
+
|
72
|
+
### Anthropic Claude Models
|
73
|
+
|
74
|
+
#### Claude-3 Family
|
75
|
+
- **claude-3-opus**: Highest capability Claude model
|
76
|
+
- Context: 200,000 tokens
|
77
|
+
- Best for: Complex analysis, long documents, nuanced tasks
|
78
|
+
- Cost: Premium pricing
|
79
|
+
|
80
|
+
- **claude-3-sonnet**: Balanced performance and cost
|
81
|
+
- Context: 200,000 tokens
|
82
|
+
- Best for: Most general tasks, good balance
|
83
|
+
- Cost: Moderate
|
84
|
+
|
85
|
+
- **claude-3-haiku**: Fastest, most economical
|
86
|
+
- Context: 200,000 tokens
|
87
|
+
- Best for: Quick tasks, batch processing, simple queries
|
88
|
+
- Cost: Most economical
|
89
|
+
|
90
|
+
#### Claude-2 Family (Legacy)
|
91
|
+
- **claude-2**: Previous generation
|
92
|
+
- Context: 100,000 tokens
|
93
|
+
- Best for: Long-form content, analysis
|
94
|
+
- Status: Being phased out
|
95
|
+
|
96
|
+
### Google Models
|
97
|
+
|
98
|
+
#### Gemini Family
|
99
|
+
- **gemini-pro**: Google's flagship model
|
100
|
+
- Context: 32,000 tokens
|
101
|
+
- Best for: Reasoning, structured data, math
|
102
|
+
- Features: Multimodal capabilities
|
103
|
+
|
104
|
+
- **gemini-pro-vision**: Gemini with vision
|
105
|
+
- Context: 32,000 tokens (including images)
|
106
|
+
- Best for: Image understanding, visual analysis
|
107
|
+
- Capabilities: Text + image input
|
108
|
+
|
109
|
+
#### PaLM Family
|
110
|
+
- **text-bison**: Text generation model
|
111
|
+
- **chat-bison**: Conversational model
|
112
|
+
|
113
|
+
### Open Source Models (via Ollama)
|
114
|
+
|
115
|
+
#### Llama 2 Family
|
116
|
+
- **llama2-7b**: 7 billion parameter model
|
117
|
+
- Best for: Local deployment, privacy-sensitive tasks
|
118
|
+
- Requirements: 8GB+ RAM
|
119
|
+
|
120
|
+
- **llama2-13b**: 13 billion parameter model
|
121
|
+
- Best for: Better quality local processing
|
122
|
+
- Requirements: 16GB+ RAM
|
123
|
+
|
124
|
+
- **llama2-70b**: 70 billion parameter model
|
125
|
+
- Best for: Highest quality local processing
|
126
|
+
- Requirements: 64GB+ RAM
|
127
|
+
|
128
|
+
#### Code Llama
|
129
|
+
- **codellama-7b**: Code-specialized 7B model
|
130
|
+
- **codellama-13b**: Code-specialized 13B model
|
131
|
+
- **codellama-34b**: Code-specialized 34B model
|
132
|
+
|
133
|
+
#### Other Open Models
|
134
|
+
- **mistral-7b**: Efficient general-purpose model
|
135
|
+
- **mixtral-8x7b**: Mixture of experts model
|
136
|
+
- **phi-2**: Microsoft's compact model
|
137
|
+
- **orca-2**: Microsoft's reasoning-focused model
|
138
|
+
|
139
|
+
## Model Capabilities
|
140
|
+
|
141
|
+
### Text Generation
|
142
|
+
**All models support**: Basic text generation, question answering, summarization
|
143
|
+
|
144
|
+
**Best performers**:
|
145
|
+
- Complex reasoning: GPT-4, Claude-3-Opus
|
146
|
+
- Creative writing: GPT-4, Claude-3-Sonnet
|
147
|
+
- Technical writing: Claude-3-Sonnet, GPT-4
|
148
|
+
|
149
|
+
### Code Understanding and Generation
|
150
|
+
**Code-optimized models**:
|
151
|
+
- CodeLlama family (7B, 13B, 34B)
|
152
|
+
- GPT-4 (excellent general code understanding)
|
153
|
+
- Claude-3-Sonnet (good at following coding standards)
|
154
|
+
|
155
|
+
**Capabilities**:
|
156
|
+
- Code generation and completion
|
157
|
+
- Bug detection and fixing
|
158
|
+
- Code explanation and documentation
|
159
|
+
- Refactoring suggestions
|
160
|
+
|
161
|
+
### Vision and Multimodal
|
162
|
+
**Image understanding models**:
|
163
|
+
- GPT-4 Vision Preview
|
164
|
+
- Gemini Pro Vision
|
165
|
+
- Claude-3 (limited vision capabilities)
|
166
|
+
|
167
|
+
**Capabilities**:
|
168
|
+
- Image description and analysis
|
169
|
+
- Chart and diagram interpretation
|
170
|
+
- OCR and text extraction
|
171
|
+
- Visual question answering
|
172
|
+
|
173
|
+
### Function Calling and Tools
|
174
|
+
**Tool-compatible models**:
|
175
|
+
- GPT-3.5-turbo (excellent function calling)
|
176
|
+
- GPT-4 (sophisticated tool usage)
|
177
|
+
- Claude-3-Sonnet (good tool integration)
|
178
|
+
|
179
|
+
**Use cases**:
|
180
|
+
- API integrations
|
181
|
+
- Database queries
|
182
|
+
- File system operations
|
183
|
+
- External service calls
|
184
|
+
|
185
|
+
## Choosing the Right Model
|
186
|
+
|
187
|
+
### By Task Type
|
188
|
+
|
189
|
+
#### Quick Tasks and Batch Processing
|
190
|
+
```bash
|
191
|
+
# Fast, economical models
|
192
|
+
aia --model gpt-3.5-turbo simple_task
|
193
|
+
aia --model claude-3-haiku batch_processing
|
194
|
+
```
|
195
|
+
|
196
|
+
#### Complex Analysis and Reasoning
|
197
|
+
```bash
|
198
|
+
# High-capability models
|
199
|
+
aia --model gpt-4 complex_analysis
|
200
|
+
aia --model claude-3-opus comprehensive_research
|
201
|
+
```
|
202
|
+
|
203
|
+
#### Code-Related Tasks
|
204
|
+
```bash
|
205
|
+
# Code-optimized models
|
206
|
+
aia --model codellama-34b code_generation
|
207
|
+
aia --model gpt-4 code_review
|
208
|
+
```
|
209
|
+
|
210
|
+
#### Long Documents
|
211
|
+
```bash
|
212
|
+
# Large context models
|
213
|
+
aia --model claude-3-sonnet long_document.pdf
|
214
|
+
aia --model gpt-4-turbo comprehensive_analysis.md
|
215
|
+
```
|
216
|
+
|
217
|
+
#### Image Analysis
|
218
|
+
```bash
|
219
|
+
# Vision-capable models
|
220
|
+
aia --model gpt-4-vision-preview image_analysis.jpg
|
221
|
+
aia --model gemini-pro-vision chart_interpretation.png
|
222
|
+
```
|
223
|
+
|
224
|
+
### By Budget Considerations
|
225
|
+
|
226
|
+
#### Cost-Effective Options
|
227
|
+
- **gpt-3.5-turbo**: Best general-purpose budget option
|
228
|
+
- **claude-3-haiku**: Anthropic's economical choice
|
229
|
+
- **Local models**: Ollama-based models (compute cost only)
|
230
|
+
|
231
|
+
#### Premium Options
|
232
|
+
- **gpt-4**: OpenAI's flagship
|
233
|
+
- **claude-3-opus**: Anthropic's highest capability
|
234
|
+
- **gpt-4-turbo**: Large context with good performance
|
235
|
+
|
236
|
+
### By Privacy and Security
|
237
|
+
|
238
|
+
#### Cloud-Based (Standard)
|
239
|
+
- OpenAI models (GPT-3.5, GPT-4)
|
240
|
+
- Anthropic models (Claude-3 family)
|
241
|
+
- Google models (Gemini family)
|
242
|
+
|
243
|
+
#### Local/Self-Hosted
|
244
|
+
- Ollama models (Llama 2, CodeLlama, Mistral)
|
245
|
+
- Privacy-focused deployment
|
246
|
+
- Full control over data
|
247
|
+
|
248
|
+
## Model Configuration Examples
|
249
|
+
|
250
|
+
### Development Workflow
|
251
|
+
```yaml
|
252
|
+
# Different models for different stages
|
253
|
+
development:
|
254
|
+
quick_tasks: gpt-3.5-turbo
|
255
|
+
code_review: gpt-4
|
256
|
+
documentation: claude-3-sonnet
|
257
|
+
testing: codellama-13b
|
258
|
+
```
|
259
|
+
|
260
|
+
### Content Creation Workflow
|
261
|
+
```yaml
|
262
|
+
content:
|
263
|
+
research: claude-3-sonnet
|
264
|
+
drafting: gpt-4
|
265
|
+
editing: claude-3-opus
|
266
|
+
seo_optimization: gpt-3.5-turbo
|
267
|
+
```
|
268
|
+
|
269
|
+
### Analysis Workflow
|
270
|
+
```yaml
|
271
|
+
analysis:
|
272
|
+
data_exploration: claude-3-sonnet
|
273
|
+
statistical_analysis: gemini-pro
|
274
|
+
insights: gpt-4
|
275
|
+
reporting: claude-3-haiku
|
276
|
+
```
|
277
|
+
|
278
|
+
## Model Performance Comparison
|
279
|
+
|
280
|
+
### Speed (Responses per minute)
|
281
|
+
1. **gpt-3.5-turbo**: ~60 RPM
|
282
|
+
2. **claude-3-haiku**: ~50 RPM
|
283
|
+
3. **gemini-pro**: ~40 RPM
|
284
|
+
4. **gpt-4**: ~20 RPM
|
285
|
+
5. **claude-3-opus**: ~15 RPM
|
286
|
+
|
287
|
+
### Context Window Size
|
288
|
+
1. **Claude-3 family**: 200,000 tokens
|
289
|
+
2. **GPT-4-turbo**: 128,000 tokens
|
290
|
+
3. **Gemini-pro**: 32,000 tokens
|
291
|
+
4. **GPT-3.5-turbo-16k**: 16,384 tokens
|
292
|
+
5. **GPT-4**: 8,192 tokens
|
293
|
+
|
294
|
+
### Cost Efficiency (approximate)
|
295
|
+
1. **gpt-3.5-turbo**: Most economical
|
296
|
+
2. **claude-3-haiku**: Very economical
|
297
|
+
3. **gemini-pro**: Moderate
|
298
|
+
4. **claude-3-sonnet**: Moderate-high
|
299
|
+
5. **gpt-4**: Premium
|
300
|
+
6. **claude-3-opus**: Most expensive
|
301
|
+
|
302
|
+
## Advanced Model Usage
|
303
|
+
|
304
|
+
### Multi-Model Strategies
|
305
|
+
```bash
|
306
|
+
# Use different models for different aspects
|
307
|
+
aia --model gpt-3.5-turbo initial_analysis.txt
|
308
|
+
aia --model gpt-4 --include initial_analysis.txt detailed_review.txt
|
309
|
+
aia --model claude-3-sonnet --include detailed_review.txt final_synthesis.txt
|
310
|
+
```
|
311
|
+
|
312
|
+
### Model Switching Based on Content
|
313
|
+
```ruby
|
314
|
+
# Dynamic model selection
|
315
|
+
//ruby
|
316
|
+
content_size = File.read('<%= input %>').length
|
317
|
+
complexity = content_size > 10000 ? 'high' : 'low'
|
318
|
+
|
319
|
+
model = case complexity
|
320
|
+
when 'high' then 'claude-3-sonnet'
|
321
|
+
when 'low' then 'gpt-3.5-turbo'
|
322
|
+
end
|
323
|
+
|
324
|
+
puts "//config model #{model}"
|
325
|
+
```
|
326
|
+
|
327
|
+
### Fallback Strategies
|
328
|
+
```ruby
|
329
|
+
# Model fallback chain
|
330
|
+
//ruby
|
331
|
+
preferred_models = ['gpt-4', 'claude-3-sonnet', 'gpt-3.5-turbo']
|
332
|
+
available_models = `aia --available_models`.split("\n").map { |line| line.split.first }
|
333
|
+
|
334
|
+
selected_model = preferred_models.find { |model| available_models.include?(model) }
|
335
|
+
puts "//config model #{selected_model || 'gpt-3.5-turbo'}"
|
336
|
+
```
|
337
|
+
|
338
|
+
## Staying Current
|
339
|
+
|
340
|
+
### Model Updates
|
341
|
+
- **Check regularly**: `aia --available_models`
|
342
|
+
- **Version changes**: Models are updated periodically
|
343
|
+
- **New releases**: Follow provider announcements
|
344
|
+
- **Deprecations**: Some models may be retired
|
345
|
+
|
346
|
+
### Performance Monitoring
|
347
|
+
```bash
|
348
|
+
# Test model performance
|
349
|
+
time aia --model gpt-4 test_prompt
|
350
|
+
time aia --model claude-3-sonnet test_prompt
|
351
|
+
|
352
|
+
# Compare outputs
|
353
|
+
aia --model "gpt-4,claude-3-sonnet" --no-consensus comparison_test
|
354
|
+
```
|
355
|
+
|
356
|
+
## Related Documentation
|
357
|
+
|
358
|
+
- [Working with Models](models.md) - Model selection and configuration
|
359
|
+
- [Configuration](../configuration.md) - Model configuration options
|
360
|
+
- [CLI Reference](../cli-reference.md) - Model-related command-line options
|
361
|
+
- [Chat Mode](chat.md) - Interactive model usage
|
362
|
+
- [Advanced Prompting](../advanced-prompting.md) - Model-specific techniques
|
363
|
+
|
364
|
+
---
|
365
|
+
|
366
|
+
The AI landscape evolves rapidly. Regularly check for new models and updates to ensure you're using the best tools for your specific needs!
|