aia 0.9.15 → 0.9.17

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: acca553714c1fe19ed2a152a5ca500691d0435817369e60a1d773b9996d02802
4
- data.tar.gz: f97fd1bc43cf1d8d1a8d2364313ad59a89462c31b71648c28828faa3ddc36ab9
3
+ metadata.gz: ae5c7e9497837763b36226f8fc44aeb7dffe692c964e450938ff83aea043c10a
4
+ data.tar.gz: b839a219cb3f6e5b34d9aa02ff7f3ced77ff039816b6b2a3d9ef79076d32c302
5
5
  SHA512:
6
- metadata.gz: 3b54ffdbcc2268e9a509f4c144182249c2d02cc520b0f1f37d7ebe8a4e79400cd2e23a96f77660019c5fb205a0bdf5df8eff14c3809f24c58886aee1fbde306f
7
- data.tar.gz: 57a0a68ddedd0bdd69a5f25802cb9a09f8c300829d2e48c2f6025147eae3b29c861d47004614dc33108cf3a403605ee98ad9c0c239aae47e05afb8def40fb738
6
+ metadata.gz: 7df6fe4bbf0fd2ce33b9827390340d3cf1f8fd5ad5b4f52ceb343769dee6d699ab87c5dd2686472cd480bf5ac1e20b612f5c69e70b72eab68735560601423d7c
7
+ data.tar.gz: 9fa99822319f6e3ff213f62ba0c26121c045e4fa96035596df46b4d723df72cecb19c1abb98f760e6b435941a3cc9b869f6401da771452c3d226930b4f4ea104
data/.version CHANGED
@@ -1 +1 @@
1
- 0.9.15
1
+ 0.9.17
data/CHANGELOG.md CHANGED
@@ -1,5 +1,67 @@
1
1
  # Changelog
2
2
  ## [Unreleased]
3
+
4
+ ### [0.9.17] 2025-10-04
5
+
6
+ #### New Features
7
+ - **NEW FEATURE**: Enhanced local model support with comprehensive validation and error handling
8
+ - **NEW FEATURE**: Added `lms/` prefix support for LM Studio models with automatic validation against loaded models
9
+ - **NEW FEATURE**: Enhanced `//models` directive to auto-detect and display local providers (Ollama and LM Studio)
10
+ - **NEW FEATURE**: Added model name prefix display in error messages for LM Studio (`lms/` prefix)
11
+
12
+ #### Improvements
13
+ - **ENHANCEMENT**: Improved LM Studio integration with model validation against `/v1/models` endpoint
14
+ - **ENHANCEMENT**: Enhanced error messages showing exact model names with correct prefixes when validation fails
15
+ - **ENHANCEMENT**: Added environment variable support for custom LM Studio API base (`LMS_API_BASE`)
16
+ - **ENHANCEMENT**: Improved `//models` directive output formatting for local models with size and modified date for Ollama
17
+ - **ENHANCEMENT**: Enhanced multi-model support to seamlessly mix local and cloud models
18
+
19
+ #### Documentation
20
+ - **DOCUMENTATION**: Added comprehensive local model documentation to README.md
21
+ - **DOCUMENTATION**: Created new docs/guides/local-models.md guide covering Ollama and LM Studio setup, usage, and troubleshooting
22
+ - **DOCUMENTATION**: Updated docs/guides/models.md with local provider sections including comparison table and workflow examples
23
+ - **DOCUMENTATION**: Enhanced docs/faq.md with 5 new FAQ entries covering local model usage, differences, and error handling
24
+
25
+ #### Technical Changes
26
+ - Enhanced RubyLLMAdapter with LM Studio model validation (lib/aia/ruby_llm_adapter.rb)
27
+ - Updated models directive to query local provider endpoints (lib/aia/directives/models.rb)
28
+ - Added provider_fix extension for RubyLLM compatibility (lib/extensions/ruby_llm/provider_fix.rb)
29
+ - Added comprehensive test coverage with 22 new tests for local providers
30
+ - Updated dependencies: ruby_llm, webmock, crack, rexml
31
+ - Bumped Ruby bundler version to 2.7.2
32
+
33
+ #### Bug Fixes
34
+ - **BUG FIX**: Fixed missing `lms/` prefix in LM Studio model listings
35
+ - **BUG FIX**: Fixed model validation error messages to show usable model names with correct prefixes
36
+ - **BUG FIX**: Fixed Ollama endpoint to use native API (removed incorrect `/v1` suffix)
37
+
38
+ #### Usage Examples
39
+ ```bash
40
+ # Use LM Studio with validation
41
+ aia --model lms/qwen/qwen3-coder-30b my_prompt
42
+
43
+ # Use Ollama
44
+ aia --model ollama/llama3.2 --chat
45
+
46
+ # Mix local and cloud models
47
+ aia --model ollama/llama3.2,gpt-4o-mini,claude-3-sonnet my_prompt
48
+
49
+ # List available local models
50
+ aia --model ollama/llama3.2 --chat
51
+ > //models
52
+ ```
53
+
54
+ ### [0.9.16] 2025-09-26
55
+
56
+ #### New Features
57
+ - **NEW FEATURE**: Added support for Ollama AI provider
58
+ - **NEW FEATURE**: Added support for Osaurus AI provider
59
+ - **NEW FEATURE**: Added support for LM Studio AI provider
60
+
61
+ #### Improvements
62
+ - **ENHANCEMENT**: Expanded AI provider ecosystem with three new local/self-hosted model options
63
+ - **ENHANCEMENT**: Improved flexibility for users preferring local LLM deployments
64
+
3
65
  ## Released
4
66
  ### [0.9.15] 2025-09-21
5
67
 
data/README.md CHANGED
@@ -563,6 +563,83 @@ Model Details:
563
563
  - **Error Handling**: Invalid models are reported but don't prevent valid models from working
564
564
  - **Batch Mode Support**: Multi-model responses are properly formatted in output files
565
565
 
566
+ ### Local Model Support
567
+
568
+ AIA supports running local AI models through Ollama and LM Studio, providing privacy, offline capability, and cost savings.
569
+
570
+ #### Ollama Integration
571
+
572
+ [Ollama](https://ollama.ai) runs AI models locally on your machine.
573
+
574
+ ```bash
575
+ # Install Ollama (macOS)
576
+ brew install ollama
577
+
578
+ # Pull a model
579
+ ollama pull llama3.2
580
+
581
+ # Use with AIA - prefix model name with 'ollama/'
582
+ aia --model ollama/llama3.2 my_prompt
583
+
584
+ # In chat mode
585
+ aia --chat --model ollama/llama3.2
586
+
587
+ # Combine with cloud models
588
+ aia --model ollama/llama3.2,gpt-4o-mini --consensus my_prompt
589
+ ```
590
+
591
+ **Environment Variables:**
592
+ ```bash
593
+ # Optional: Set custom Ollama API endpoint
594
+ export OLLAMA_API_BASE=http://localhost:11434
595
+ ```
596
+
597
+ #### LM Studio Integration
598
+
599
+ [LM Studio](https://lmstudio.ai) provides a desktop application for running local models with an OpenAI-compatible API.
600
+
601
+ ```bash
602
+ # 1. Install LM Studio from lmstudio.ai
603
+ # 2. Download and load a model in LM Studio
604
+ # 3. Start the local server in LM Studio
605
+
606
+ # Use with AIA - prefix model name with 'lms/'
607
+ aia --model lms/qwen/qwen3-coder-30b my_prompt
608
+
609
+ # In chat mode
610
+ aia --chat --model lms/your-model-name
611
+
612
+ # Mix local and cloud models
613
+ aia --model lms/local-model,gpt-4o-mini my_prompt
614
+ ```
615
+
616
+ **Environment Variables:**
617
+ ```bash
618
+ # Optional: Set custom LM Studio API endpoint (default: http://localhost:1234/v1)
619
+ export LMS_API_BASE=http://localhost:1234/v1
620
+ ```
621
+
622
+ #### Listing Local Models
623
+
624
+ The `//models` directive automatically detects local providers and queries their endpoints:
625
+
626
+ ```bash
627
+ # In a prompt file or chat session
628
+ //models
629
+
630
+ # Output will show:
631
+ # - Ollama models from http://localhost:11434/api/tags
632
+ # - LM Studio models from http://localhost:1234/v1/models
633
+ # - Cloud models from RubyLLM database
634
+ ```
635
+
636
+ **Benefits of Local Models:**
637
+ - 🔒 **Privacy**: No data sent to external servers
638
+ - 💰 **Cost**: Zero API costs after initial setup
639
+ - 🚀 **Speed**: No network latency
640
+ - 📡 **Offline**: Works without internet connection
641
+ - 🔧 **Control**: Full control over model and parameters
642
+
566
643
  ### Shell Integration
567
644
 
568
645
  AIA automatically processes shell patterns in prompts:
data/docs/faq.md CHANGED
@@ -23,7 +23,89 @@ export ANTHROPIC_API_KEY="your_key_here"
23
23
  ```
24
24
 
25
25
  ### Q: Can I use AIA without internet access?
26
- **A:** Yes, if you use local models through Ollama. Most AI models require internet access, but you can run models locally for offline use.
26
+ **A:** Yes! AIA supports two local model providers for complete offline operation:
27
+
28
+ 1. **Ollama**: Run open-source models locally
29
+ ```bash
30
+ # Install and use Ollama
31
+ brew install ollama
32
+ ollama pull llama3.2
33
+ aia --model ollama/llama3.2 --chat
34
+ ```
35
+
36
+ 2. **LM Studio**: GUI-based local model runner
37
+ ```bash
38
+ # Download from https://lmstudio.ai
39
+ # Load a model and start local server
40
+ aia --model lms/your-model-name --chat
41
+ ```
42
+
43
+ Both options provide full AI functionality without internet connection, perfect for:
44
+ - 🔒 Private/sensitive data processing
45
+ - ✈️ Offline/travel use
46
+ - 💰 Zero API costs
47
+ - 🏠 Air-gapped environments
48
+
49
+ ### Q: How do I list available local models?
50
+ **A:** Use the `//models` directive in a chat session or prompt:
51
+
52
+ ```bash
53
+ # Start chat with any local model
54
+ aia --model ollama/llama3.2 --chat
55
+
56
+ # In the chat session
57
+ > //models
58
+
59
+ # Output shows:
60
+ # - Ollama models from local installation
61
+ # - LM Studio models currently loaded
62
+ # - Cloud models from RubyLLM database
63
+ ```
64
+
65
+ For Ollama specifically: `ollama list`
66
+ For LM Studio: Check the Models tab in the LM Studio GUI
67
+
68
+ ### Q: What's the difference between Ollama and LM Studio?
69
+ **A:**
70
+ - **Ollama**: Command-line focused, quick model switching, multiple models available
71
+ - **LM Studio**: GUI application, visual model management, one model at a time
72
+
73
+ Choose **Ollama** if you prefer CLI tools and automation.
74
+ Choose **LM Studio** if you want a visual interface and easier model discovery.
75
+
76
+ Both work great with AIA!
77
+
78
+ ### Q: Can I mix local and cloud models?
79
+ **A:** Absolutely! This is a powerful feature:
80
+
81
+ ```bash
82
+ # Compare local vs cloud responses
83
+ aia --model ollama/llama3.2,gpt-4o-mini my_prompt
84
+
85
+ # Get consensus across local and cloud models
86
+ aia --model ollama/mistral,lms/qwen-coder,claude-3-sonnet --consensus decision
87
+
88
+ # Use local for drafts, cloud for refinement
89
+ aia --model ollama/llama3.2 --out_file draft.md initial_analysis
90
+ aia --model gpt-4 --include draft.md final_report
91
+ ```
92
+
93
+ ### Q: Why does my lms/ model show an error?
94
+ **A:** Common causes:
95
+
96
+ 1. **Model not loaded in LM Studio**: Load a model first
97
+ 2. **Wrong model name**: AIA validates against available models and shows the exact names to use
98
+ 3. **Server not running**: Start the local server in LM Studio
99
+ 4. **Wrong prefix**: Always use `lms/` prefix with full model name
100
+
101
+ If you get an error, AIA will show you the exact model names to use:
102
+ ```
103
+ ❌ 'wrong-name' is not a valid LM Studio model.
104
+
105
+ Available LM Studio models:
106
+ - lms/qwen/qwen3-coder-30b
107
+ - lms/llama-3.2-3b-instruct
108
+ ```
27
109
 
28
110
  ## Basic Usage
29
111
 
@@ -0,0 +1,304 @@
1
+ # Local Models Guide
2
+
3
+ Complete guide to using Ollama and LM Studio with AIA for local AI processing.
4
+
5
+ ## Why Use Local Models?
6
+
7
+ ### Benefits
8
+
9
+ - 🔒 **Privacy**: All processing happens on your machine
10
+ - 💰 **Cost**: No API fees
11
+ - 🚀 **Speed**: No network latency
12
+ - 📡 **Offline**: Works without internet
13
+ - 🔧 **Control**: Choose exact model and parameters
14
+ - 📦 **Unlimited**: No rate limits or quotas
15
+
16
+ ### Use Cases
17
+
18
+ - Processing confidential business data
19
+ - Working with personal information
20
+ - Development and testing
21
+ - High-volume batch processing
22
+ - Air-gapped environments
23
+ - Learning and experimentation
24
+
25
+ ## Ollama Setup
26
+
27
+ ### Installation
28
+
29
+ ```bash
30
+ # macOS
31
+ brew install ollama
32
+
33
+ # Linux
34
+ curl -fsSL https://ollama.ai/install.sh | sh
35
+
36
+ # Windows
37
+ # Download installer from https://ollama.ai
38
+ ```
39
+
40
+ ### Model Management
41
+
42
+ ```bash
43
+ # List available models
44
+ ollama list
45
+
46
+ # Pull new models
47
+ ollama pull llama3.2
48
+ ollama pull mistral
49
+ ollama pull codellama
50
+
51
+ # Remove models
52
+ ollama rm model-name
53
+
54
+ # Show model info
55
+ ollama show llama3.2
56
+ ```
57
+
58
+ ### Using with AIA
59
+
60
+ ```bash
61
+ # Basic usage - prefix with 'ollama/'
62
+ aia --model ollama/llama3.2 my_prompt
63
+
64
+ # Chat mode
65
+ aia --chat --model ollama/mistral
66
+
67
+ # Batch processing
68
+ for file in *.md; do
69
+ aia --model ollama/llama3.2 summarize "$file"
70
+ done
71
+ ```
72
+
73
+ ### Recommended Ollama Models
74
+
75
+ #### General Purpose
76
+ - `llama3.2` - Versatile, good quality
77
+ - `llama3.2:70b` - Higher quality, slower
78
+ - `mistral` - Fast, efficient
79
+
80
+ #### Code
81
+ - `qwen2.5-coder` - Excellent for code
82
+ - `codellama` - Code-focused
83
+ - `deepseek-coder` - Programming tasks
84
+
85
+ #### Specialized
86
+ - `mixtral` - High performance
87
+ - `phi3` - Small, efficient
88
+ - `gemma2` - Google's open model
89
+
90
+ ## LM Studio Setup
91
+
92
+ ### Installation
93
+
94
+ 1. Download from https://lmstudio.ai
95
+ 2. Install the application
96
+ 3. Launch LM Studio
97
+
98
+ ### Model Management
99
+
100
+ 1. Click "🔍 Search" tab
101
+ 2. Browse or search for models
102
+ 3. Click download button
103
+ 4. Wait for download to complete
104
+
105
+ ### Starting Local Server
106
+
107
+ 1. Click "💻 Local Server" tab
108
+ 2. Select loaded model from dropdown
109
+ 3. Click "Start Server"
110
+ 4. Note the endpoint (default: http://localhost:1234/v1)
111
+
112
+ ### Using with AIA
113
+
114
+ ```bash
115
+ # Prefix model name with 'lms/'
116
+ aia --model lms/qwen/qwen3-coder-30b my_prompt
117
+
118
+ # Chat mode
119
+ aia --chat --model lms/llama-3.2-3b-instruct
120
+
121
+ # AIA validates model names
122
+ # Error shows available models if name is wrong
123
+ ```
124
+
125
+ ### Popular LM Studio Models
126
+
127
+ - `lmsys/vicuna-7b` - Conversation
128
+ - `TheBloke/Llama-2-7B-Chat-GGUF` - Chat
129
+ - `TheBloke/CodeLlama-7B-GGUF` - Code
130
+ - `qwen/qwen3-coder-30b` - Advanced coding
131
+
132
+ ## Configuration
133
+
134
+ ### Environment Variables
135
+
136
+ ```bash
137
+ # Ollama custom endpoint
138
+ export OLLAMA_API_BASE=http://localhost:11434
139
+
140
+ # LM Studio custom endpoint
141
+ export LMS_API_BASE=http://localhost:1234/v1
142
+ ```
143
+
144
+ ### Config File
145
+
146
+ ```yaml
147
+ # ~/.aia/config.yml
148
+ model: ollama/llama3.2
149
+
150
+ # Or for LM Studio
151
+ model: lms/qwen/qwen3-coder-30b
152
+ ```
153
+
154
+ ### In Prompts
155
+
156
+ ```
157
+ //config model = ollama/mistral
158
+ //config temperature = 0.7
159
+
160
+ Your prompt here...
161
+ ```
162
+
163
+ ## Listing Models
164
+
165
+ ### In Chat Session
166
+
167
+ ```bash
168
+ aia --model ollama/llama3.2 --chat
169
+ > //models
170
+ ```
171
+
172
+ **Ollama Output:**
173
+ ```
174
+ Local LLM Models:
175
+
176
+ Ollama Models (http://localhost:11434):
177
+ ------------------------------------------------------------
178
+ - ollama/llama3.2:latest (size: 2.0 GB, modified: 2024-10-01)
179
+ - ollama/mistral:latest (size: 4.1 GB, modified: 2024-09-28)
180
+
181
+ 2 Ollama model(s) available
182
+ ```
183
+
184
+ **LM Studio Output:**
185
+ ```
186
+ Local LLM Models:
187
+
188
+ LM Studio Models (http://localhost:1234/v1):
189
+ ------------------------------------------------------------
190
+ - lms/qwen/qwen3-coder-30b
191
+ - lms/llama-3.2-3b-instruct
192
+
193
+ 2 LM Studio model(s) available
194
+ ```
195
+
196
+ ## Advanced Usage
197
+
198
+ ### Mixed Local/Cloud Models
199
+
200
+ ```bash
201
+ # Compare local and cloud responses
202
+ aia --model ollama/llama3.2,gpt-4o-mini,claude-3-sonnet analysis_prompt
203
+
204
+ # Get consensus
205
+ aia --model ollama/llama3.2,ollama/mistral,gpt-4 --consensus decision_prompt
206
+ ```
207
+
208
+ ### Local-First Workflow
209
+
210
+ ```bash
211
+ # 1. Process with local model (private)
212
+ aia --model ollama/llama3.2 --out_file draft.md sensitive_data.txt
213
+
214
+ # 2. Review and sanitize draft.md manually
215
+
216
+ # 3. Polish with cloud model
217
+ aia --model gpt-4 --include draft.md final_output
218
+ ```
219
+
220
+ ### Cost Optimization
221
+
222
+ ```bash
223
+ # Bulk tasks with local model
224
+ for i in {1..1000}; do
225
+ aia --model ollama/mistral --out_file "result_$i.md" process "input_$i.txt"
226
+ done
227
+
228
+ # No API costs!
229
+ ```
230
+
231
+ ## Troubleshooting
232
+
233
+ ### Ollama Issues
234
+
235
+ **Problem:** "Cannot connect to Ollama"
236
+ ```bash
237
+ # Check if Ollama is running
238
+ ollama list
239
+
240
+ # Start Ollama service (if needed)
241
+ ollama serve
242
+ ```
243
+
244
+ **Problem:** "Model not found"
245
+ ```bash
246
+ # List installed models
247
+ ollama list
248
+
249
+ # Pull missing model
250
+ ollama pull llama3.2
251
+ ```
252
+
253
+ ### LM Studio Issues
254
+
255
+ **Problem:** "Cannot connect to LM Studio"
256
+ 1. Ensure LM Studio is running
257
+ 2. Check local server is started
258
+ 3. Verify endpoint in settings
259
+
260
+ **Problem:** "Model validation failed"
261
+ - Check exact model name in LM Studio
262
+ - Ensure model is loaded (not just downloaded)
263
+ - Use full model path with `lms/` prefix
264
+
265
+ **Problem:** "Model not listed"
266
+ 1. Load model in LM Studio
267
+ 2. Start local server
268
+ 3. Run `//models` directive
269
+
270
+ ### Performance Issues
271
+
272
+ **Slow responses:**
273
+ - Use smaller models (7B instead of 70B)
274
+ - Reduce max_tokens
275
+ - Check system resources (CPU/RAM/GPU)
276
+
277
+ **High memory usage:**
278
+ - Close other applications
279
+ - Use quantized models (Q4, Q5)
280
+ - Try smaller model variants
281
+
282
+ ## Best Practices
283
+
284
+ ### Security
285
+ ✅ Keep local models for sensitive data
286
+ ✅ Use cloud models for general tasks
287
+ ✅ Review outputs before sharing externally
288
+
289
+ ### Performance
290
+ ✅ Use appropriate model size for task
291
+ ✅ Leverage GPU if available
292
+ ✅ Cache common responses
293
+
294
+ ### Cost Management
295
+ ✅ Use local models for development/testing
296
+ ✅ Use local models for high-volume processing
297
+ ✅ Reserve cloud models for critical tasks
298
+
299
+ ## Related Documentation
300
+
301
+ - [Models Guide](models.md)
302
+ - [Configuration](../configuration.md)
303
+ - [Chat Mode](chat.md)
304
+ - [CLI Reference](../cli-reference.md)