ace-llm 0.36.3 → 0.38.2
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/.ace-defaults/llm/providers/anthropic.yml +29 -14
- data/.ace-defaults/llm/providers/google.yml +28 -14
- data/.ace-defaults/llm/providers/groq.yml +60 -5
- data/.ace-defaults/llm/providers/lmstudio.yml +1 -1
- data/.ace-defaults/llm/providers/mistral.yml +45 -14
- data/.ace-defaults/llm/providers/openai.yml +46 -14
- data/.ace-defaults/llm/providers/openrouter.yml +229 -32
- data/.ace-defaults/llm/providers/togetherai.yml +43 -10
- data/.ace-defaults/llm/providers/xai.yml +21 -8
- data/.ace-defaults/llm/providers/zai.yml +17 -6
- data/CHANGELOG.md +43 -0
- data/README.md +2 -0
- data/exe/ace-llm +2 -1
- data/handbook/guides/llm-query-tool-reference.g.md +78 -626
- data/lib/ace/llm/atoms/provider_config_validator.rb +53 -0
- data/lib/ace/llm/cli/commands/query.rb +10 -2
- data/lib/ace/llm/molecules/model_limit_resolver.rb +88 -0
- data/lib/ace/llm/version.rb +1 -1
- data/lib/ace/llm.rb +1 -0
- metadata +5 -4
|
@@ -1,683 +1,135 @@
|
|
|
1
1
|
---
|
|
2
2
|
doc-type: guide
|
|
3
|
-
title:
|
|
3
|
+
title: ace-llm Query Reference Guide
|
|
4
4
|
purpose: Documentation for ace-llm/handbook/guides/llm-query-tool-reference.g.md
|
|
5
5
|
ace-docs:
|
|
6
|
-
last-updated: 2026-
|
|
7
|
-
last-checked: 2026-
|
|
6
|
+
last-updated: 2026-04-23
|
|
7
|
+
last-checked: 2026-04-23
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
#
|
|
10
|
+
# ace-llm Query Reference Guide
|
|
11
11
|
|
|
12
12
|
## Purpose
|
|
13
13
|
|
|
14
|
-
This guide
|
|
14
|
+
This guide summarizes the current `ace-llm` query surface for handbook consumers that need concise command patterns, alias behavior, and provider-specific notes.
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Command Surface
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Basic Syntax
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
llm-query PROVIDER_MODEL PROMPT [OPTIONS]
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Quick Examples
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# Basic query
|
|
30
|
-
llm-query google:gemini-2.5-flash "What is Ruby programming language?"
|
|
31
|
-
|
|
32
|
-
# With system prompt and output
|
|
33
|
-
llm-query anthropic:claude-sonnet-4-20250514 "Review this code" \
|
|
34
|
-
--system system.md \
|
|
35
|
-
--output review.md \
|
|
36
|
-
--timeout 300
|
|
37
|
-
|
|
38
|
-
# Using alias with file input
|
|
39
|
-
llm-query gflash prompt.txt --format json --output response.json
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Parameter Reference
|
|
43
|
-
|
|
44
|
-
### Required Arguments
|
|
45
|
-
|
|
46
|
-
#### `PROVIDER_MODEL`
|
|
47
|
-
|
|
48
|
-
Specifies the LLM provider and model to use.
|
|
49
|
-
|
|
50
|
-
**Format Options:**
|
|
51
|
-
|
|
52
|
-
- `provider:model` - Full specification (e.g., `google:gemini-2.5-flash`)
|
|
53
|
-
- `provider` - Provider only, uses default model (e.g., `google`)
|
|
54
|
-
- `alias` - Predefined alias (e.g., `gflash`)
|
|
55
|
-
|
|
56
|
-
**Supported Providers:**
|
|
57
|
-
|
|
58
|
-
- `google` - Google Gemini models
|
|
59
|
-
- `anthropic` - Anthropic Claude models
|
|
60
|
-
- `openai` - OpenAI GPT models
|
|
61
|
-
- `mistral` - Mistral AI models
|
|
62
|
-
- `togetherai` - Together AI models
|
|
63
|
-
- `lmstudio` - Local LM Studio models
|
|
64
|
-
|
|
65
|
-
#### `PROMPT`
|
|
66
|
-
|
|
67
|
-
The prompt text or file path to process.
|
|
68
|
-
|
|
69
|
-
**Input Types:**
|
|
70
|
-
|
|
71
|
-
- **Direct text**: `"What is Ruby programming language?"`
|
|
72
|
-
- **File path**: `prompt.txt` (auto-detected based on file existence)
|
|
73
|
-
- **Stdin**: Use `-` to read from stdin
|
|
74
|
-
|
|
75
|
-
### Optional Parameters
|
|
76
|
-
|
|
77
|
-
#### `--system` / System Instructions
|
|
78
|
-
|
|
79
|
-
Specify system instructions/prompts separately from user prompts.
|
|
80
|
-
|
|
81
|
-
**Format:** `--system VALUE`
|
|
82
|
-
**Type:** String
|
|
83
|
-
**Input Types:**
|
|
84
|
-
|
|
85
|
-
- **Direct text**: `--system "You are a helpful assistant"`
|
|
86
|
-
- **File path**: `--system system.md` (auto-detected)
|
|
87
|
-
|
|
88
|
-
**Usage:**
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
# Direct system prompt
|
|
92
|
-
llm-query google:gemini-2.5-pro "Explain quantum computing" \
|
|
93
|
-
--system "You are a physics professor. Be precise and educational."
|
|
94
|
-
|
|
95
|
-
# System prompt from file
|
|
96
|
-
llm-query anthropic:claude-sonnet-4-20250514 "Review this code" \
|
|
97
|
-
--system tmpl://review-code/system
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
#### `--output` / `-o` / File Output
|
|
101
|
-
|
|
102
|
-
Direct output to a file with automatic format detection.
|
|
103
|
-
|
|
104
|
-
**Format:** `--output FILEPATH` or `-o FILEPATH`
|
|
105
|
-
**Type:** String
|
|
106
|
-
**Benefits:**
|
|
107
|
-
|
|
108
|
-
- Captures cost information and usage metrics
|
|
109
|
-
- Enables cost tracking and optimization
|
|
110
|
-
- Prevents output truncation issues
|
|
111
|
-
- Supports format inference from file extension
|
|
112
|
-
|
|
113
|
-
**Usage:**
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
# Auto-detect format from extension
|
|
117
|
-
llm-query gflash "Generate README" --output README.md
|
|
118
|
-
|
|
119
|
-
# Explicit format override
|
|
120
|
-
llm-query csonet "Data analysis" --output report.txt --format json
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
#### `--format` / Output Format
|
|
124
|
-
|
|
125
|
-
Override output format (normally inferred from file extension).
|
|
126
|
-
|
|
127
|
-
**Format:** `--format VALUE`
|
|
128
|
-
**Type:** String
|
|
129
|
-
**Values:** `text`, `json`, `markdown`
|
|
130
|
-
**Default:** Inferred from file extension or `text`
|
|
131
|
-
|
|
132
|
-
**Usage:**
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
# Force JSON output despite .txt extension
|
|
136
|
-
llm-query openai:gpt-4o "Generate data" --output data.txt --format json
|
|
137
|
-
|
|
138
|
-
# Explicit markdown formatting
|
|
139
|
-
llm-query google "Write tutorial" --format markdown
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
#### `--temperature` / Creativity Control
|
|
143
|
-
|
|
144
|
-
Control randomness/creativity in responses.
|
|
145
|
-
|
|
146
|
-
**Format:** `--temperature VALUE`
|
|
147
|
-
**Type:** Float
|
|
148
|
-
**Range:** 0.0 - 2.0
|
|
149
|
-
**Default:** Provider-specific (typically 0.7)
|
|
150
|
-
|
|
151
|
-
**Guidelines:**
|
|
152
|
-
|
|
153
|
-
- `0.0-0.3` - Deterministic, factual responses
|
|
154
|
-
- `0.4-0.7` - Balanced creativity and consistency
|
|
155
|
-
- `0.8-1.0` - Creative writing, brainstorming
|
|
156
|
-
- `1.1-2.0` - Highly creative, experimental
|
|
157
|
-
|
|
158
|
-
**Usage:**
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
# Deterministic code review
|
|
162
|
-
llm-query anthropic:claude-sonnet-4-20250514 "Review code" --temperature 0.2
|
|
163
|
-
|
|
164
|
-
# Creative writing
|
|
165
|
-
llm-query google:gemini-2.5-pro "Write a story" --temperature 1.2
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
#### `--max-tokens` / Output Length Control
|
|
169
|
-
|
|
170
|
-
Limit maximum output tokens.
|
|
171
|
-
|
|
172
|
-
**Format:** `--max-tokens VALUE`
|
|
173
|
-
**Type:** Integer
|
|
174
|
-
**Default:** Provider-specific
|
|
175
|
-
|
|
176
|
-
**Provider Limits:**
|
|
177
|
-
|
|
178
|
-
- Google Gemini: 8,192 tokens (default)
|
|
179
|
-
- Anthropic Claude: 4,096 tokens (default)
|
|
180
|
-
- OpenAI GPT: Model-dependent
|
|
181
|
-
|
|
182
|
-
**Usage:**
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
# Short summary
|
|
186
|
-
llm-query gflash "Summarize this document" --max-tokens 150
|
|
187
|
-
|
|
188
|
-
# Long-form content
|
|
189
|
-
llm-query copus "Write detailed analysis" --max-tokens 4096
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
#### `--timeout` / Request Timeout
|
|
193
|
-
|
|
194
|
-
Set request timeout in seconds.
|
|
195
|
-
|
|
196
|
-
**Format:** `--timeout VALUE`
|
|
197
|
-
**Type:** Integer
|
|
198
|
-
**Default:** Provider-specific
|
|
199
|
-
**Recommended:** 300-500 seconds for large content
|
|
200
|
-
|
|
201
|
-
**Usage:**
|
|
202
|
-
|
|
203
|
-
```bash
|
|
204
|
-
# Extended timeout for large documents
|
|
205
|
-
llm-query anthropic:claude-sonnet-4-20250514 "$(cat large-doc.md)" \
|
|
206
|
-
--timeout 500 \
|
|
207
|
-
--output analysis.md
|
|
208
|
-
|
|
209
|
-
# Quick timeout for simple queries
|
|
210
|
-
llm-query gflash "Quick question" --timeout 30
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
#### `--debug` / `-d` / Debug Output
|
|
214
|
-
|
|
215
|
-
Enable verbose debug information.
|
|
216
|
-
|
|
217
|
-
**Format:** `--debug` or `-d`
|
|
218
|
-
**Type:** Boolean
|
|
219
|
-
**Default:** `false`
|
|
220
|
-
|
|
221
|
-
**Debug Information:**
|
|
222
|
-
|
|
223
|
-
- API request/response details
|
|
224
|
-
- Error stack traces
|
|
225
|
-
- Parameter validation details
|
|
226
|
-
- Provider-specific debugging
|
|
227
|
-
|
|
228
|
-
**Usage:**
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
# Debug API issues
|
|
232
|
-
llm-query google:gemini-2.5-flash "Test query" --debug
|
|
233
|
-
|
|
234
|
-
# Debug with output file
|
|
235
|
-
llm-query csonet "Analysis" --output result.md --debug
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
#### `--force` / `-f` / Force Overwrite
|
|
239
|
-
|
|
240
|
-
Force overwrite existing output files without confirmation.
|
|
241
|
-
|
|
242
|
-
**Format:** `--force` or `-f`
|
|
243
|
-
**Type:** Boolean
|
|
244
|
-
**Default:** `false`
|
|
245
|
-
|
|
246
|
-
**Use Cases:**
|
|
247
|
-
|
|
248
|
-
- CI/CD automation (non-interactive environments)
|
|
249
|
-
- Batch processing workflows
|
|
250
|
-
- Overwriting previous analysis results
|
|
251
|
-
|
|
252
|
-
**Usage:**
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
# Automation-friendly
|
|
256
|
-
llm-query anthropic:claude-sonnet-4-20250514 "Update analysis" \
|
|
257
|
-
--output existing-report.md \
|
|
258
|
-
--force
|
|
259
|
-
|
|
260
|
-
# Interactive workflow (prompts for confirmation)
|
|
261
|
-
llm-query gflash "New content" --output existing.md
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
## Provider-Specific Features
|
|
265
|
-
|
|
266
|
-
### Google Gemini
|
|
267
|
-
|
|
268
|
-
**Provider ID:** `google`
|
|
269
|
-
**API Key:** `GOOGLE_API_KEY` environment variable
|
|
270
|
-
**Aliases:**
|
|
271
|
-
|
|
272
|
-
- `gflash` → `google:gemini-2.5-flash`
|
|
273
|
-
- `gpro` → `google:gemini-2.5-pro`
|
|
274
|
-
|
|
275
|
-
**Available Models:**
|
|
276
|
-
|
|
277
|
-
- `gemini-2.5-flash` - Fast, efficient model
|
|
278
|
-
- `gemini-2.5-pro` - High-capability model
|
|
279
|
-
|
|
280
|
-
**Capabilities:**
|
|
281
|
-
|
|
282
|
-
- Large context windows
|
|
283
|
-
- Multimodal support (text)
|
|
284
|
-
- Fast response times
|
|
285
|
-
|
|
286
|
-
**Usage:**
|
|
287
|
-
|
|
288
|
-
```bash
|
|
289
|
-
# Using full specification
|
|
290
|
-
llm-query google:gemini-2.5-flash "Quick question"
|
|
291
|
-
|
|
292
|
-
# Using provider default
|
|
293
|
-
llm-query google "Question with default model"
|
|
294
|
-
|
|
295
|
-
# Using alias
|
|
296
|
-
llm-query gflash "Fast response needed"
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Anthropic Claude
|
|
300
|
-
|
|
301
|
-
**Provider ID:** `anthropic`
|
|
302
|
-
**API Key:** `ANTHROPIC_API_KEY` environment variable
|
|
303
|
-
**Aliases:**
|
|
304
|
-
|
|
305
|
-
- `csonet` → `anthropic:claude-sonnet-4-20250514`
|
|
306
|
-
- `copus` → `anthropic:claude-4-0-opus-latest`
|
|
307
|
-
|
|
308
|
-
**Available Models:**
|
|
309
|
-
|
|
310
|
-
- `claude-sonnet-4-20250514` - Balanced performance
|
|
311
|
-
- `claude-4-0-opus-latest` - Highest capability
|
|
312
|
-
|
|
313
|
-
**Capabilities:**
|
|
314
|
-
|
|
315
|
-
- Superior reasoning and analysis
|
|
316
|
-
- Excellent code understanding
|
|
317
|
-
- Strong safety alignment
|
|
318
|
-
|
|
319
|
-
**Usage:**
|
|
18
|
+
Use `ace-llm` to query API-backed and CLI-backed providers through one CLI:
|
|
320
19
|
|
|
321
20
|
```bash
|
|
322
|
-
|
|
323
|
-
llm
|
|
324
|
-
|
|
325
|
-
# Using alias for convenience
|
|
326
|
-
llm-query csonet "Complex reasoning task"
|
|
21
|
+
ace-llm PROVIDER[:MODEL] [PROMPT] [options]
|
|
22
|
+
ace-llm PROVIDER --prompt PROMPT [options]
|
|
23
|
+
ace-llm PROVIDER PROMPT --model MODEL [options]
|
|
327
24
|
```
|
|
328
25
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
**Provider ID:** `openai`
|
|
332
|
-
**API Key:** `OPENAI_API_KEY` environment variable
|
|
333
|
-
**Aliases:**
|
|
334
|
-
|
|
335
|
-
- `o4mini` → `openai:gpt-4o-mini`
|
|
336
|
-
|
|
337
|
-
**Available Models:**
|
|
338
|
-
|
|
339
|
-
- `gpt-4o` - Latest high-capability model
|
|
340
|
-
- `gpt-4o-mini` - Efficient model
|
|
341
|
-
- `gpt-3.5-turbo` - Fast, cost-effective
|
|
342
|
-
|
|
343
|
-
**Capabilities:**
|
|
344
|
-
|
|
345
|
-
- Strong general knowledge
|
|
346
|
-
- Good creative writing
|
|
347
|
-
- Reliable performance
|
|
348
|
-
|
|
349
|
-
### Other Providers
|
|
350
|
-
|
|
351
|
-
**Mistral AI:** `mistral`
|
|
352
|
-
**Together AI:** `togetherai`
|
|
353
|
-
**LM Studio:** `lmstudio` (local models)
|
|
354
|
-
|
|
355
|
-
Each provider follows the same parameter patterns with provider-specific defaults.
|
|
356
|
-
|
|
357
|
-
## Usage Patterns
|
|
358
|
-
|
|
359
|
-
### Pattern 1: Basic Query
|
|
360
|
-
|
|
361
|
-
**Use Case:** Simple question-answer interactions
|
|
26
|
+
Examples:
|
|
362
27
|
|
|
363
28
|
```bash
|
|
364
|
-
llm
|
|
29
|
+
ace-llm gflash "Summarize this branch"
|
|
30
|
+
ace-llm google:gemini-2.5-flash "Explain service objects in Ruby"
|
|
31
|
+
ace-llm codex:gpt:high "Review this architecture"
|
|
32
|
+
ace-llm codex:gpt@yolo "/as-assign-drive abc123@010" --interactive
|
|
365
33
|
```
|
|
366
34
|
|
|
367
|
-
|
|
35
|
+
## Common Patterns
|
|
368
36
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
```bash
|
|
372
|
-
llm-query anthropic:claude-sonnet-4-20250514 "$(cat document.md)" \
|
|
373
|
-
--system "You are a technical reviewer. Focus on accuracy and clarity." \
|
|
374
|
-
--output review.md
|
|
375
|
-
```
|
|
37
|
+
### Aliases and explicit models
|
|
376
38
|
|
|
377
|
-
|
|
39
|
+
- Use aliases when you want stable shorthand such as `gflash`, `glite`, `sonnet`, or `codex:mini`.
|
|
40
|
+
- Use `provider:model` when you need an exact model target.
|
|
41
|
+
- Use `--model` when the provider is fixed but the model varies per call.
|
|
378
42
|
|
|
379
|
-
|
|
43
|
+
Examples:
|
|
380
44
|
|
|
381
45
|
```bash
|
|
382
|
-
llm
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
--output code-review.md
|
|
46
|
+
ace-llm gflash "Quick summary"
|
|
47
|
+
ace-llm gemini:flash-latest "Check provider alias resolution"
|
|
48
|
+
ace-llm google --model gemini-3-flash-preview --prompt "Hi"
|
|
386
49
|
```
|
|
387
50
|
|
|
388
|
-
###
|
|
51
|
+
### Presets and thinking levels
|
|
389
52
|
|
|
390
|
-
|
|
53
|
+
- Append `@preset` to apply execution presets such as `@ro`, `@rw`, or `@yolo`.
|
|
54
|
+
- Append `:level` after the model for supported thinking providers such as `codex` and `claude`.
|
|
391
55
|
|
|
392
|
-
|
|
393
|
-
for file in docs/*.md; do
|
|
394
|
-
llm-query gpro "$(cat "$file")" \
|
|
395
|
-
--system "Summarize this document in 2-3 sentences." \
|
|
396
|
-
--output "summaries/$(basename "$file" .md)-summary.md" \
|
|
397
|
-
--force
|
|
398
|
-
done
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
### Pattern 5: Creative Writing
|
|
402
|
-
|
|
403
|
-
**Use Case:** Content generation
|
|
56
|
+
Examples:
|
|
404
57
|
|
|
405
58
|
```bash
|
|
406
|
-
llm
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
--output blog-post.md
|
|
59
|
+
ace-llm cc@ro "Summarize this diff"
|
|
60
|
+
ace-llm codex:gpt:high "Explain this architecture"
|
|
61
|
+
ace-llm claude:sonnet "Review this file" --preset rw
|
|
410
62
|
```
|
|
411
63
|
|
|
412
|
-
###
|
|
64
|
+
### Native interactive CLI sessions
|
|
413
65
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
```bash
|
|
417
|
-
llm-query openai:gpt-4o "$(cat data.json)" \
|
|
418
|
-
--system "Analyze this data and provide insights in JSON format." \
|
|
419
|
-
--format json \
|
|
420
|
-
--output analysis.json
|
|
421
|
-
```
|
|
66
|
+
Use `--interactive` when you want the provider's native terminal UI instead of one-shot output.
|
|
422
67
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
### System Prompt Separation
|
|
426
|
-
|
|
427
|
-
**Always use `--system` flag for system instructions:**
|
|
428
|
-
|
|
429
|
-
```bash
|
|
430
|
-
# ✅ CORRECT: Separate system and user prompts
|
|
431
|
-
llm-query csonet "Review this function" \
|
|
432
|
-
--system "You are a senior developer. Focus on best practices."
|
|
433
|
-
|
|
434
|
-
# ❌ AVOID: Embedding system instructions in user prompt
|
|
435
|
-
llm-query csonet "You are a senior developer. Review this function..."
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
**Benefits:**
|
|
439
|
-
|
|
440
|
-
- Cleaner prompt structure
|
|
441
|
-
- Better model understanding
|
|
442
|
-
- Consistent results
|
|
443
|
-
- Easier prompt management
|
|
444
|
-
|
|
445
|
-
### Output and Cost Tracking
|
|
446
|
-
|
|
447
|
-
**Use `--output` flag for important results:**
|
|
448
|
-
|
|
449
|
-
```bash
|
|
450
|
-
# ✅ CORRECT: Direct file output with cost tracking
|
|
451
|
-
llm-query gpro "Generate report" \
|
|
452
|
-
--output report.md \
|
|
453
|
-
--timeout 300
|
|
454
|
-
|
|
455
|
-
# ❌ SUBOPTIMAL: Manual redirection loses cost information
|
|
456
|
-
llm-query gpro "Generate report" > report.md
|
|
457
|
-
```
|
|
458
|
-
|
|
459
|
-
**Benefits:**
|
|
460
|
-
|
|
461
|
-
- Cost information captured
|
|
462
|
-
- Usage metrics available
|
|
463
|
-
- No output truncation
|
|
464
|
-
- Better error handling
|
|
465
|
-
|
|
466
|
-
### Timeout Management
|
|
467
|
-
|
|
468
|
-
**Set appropriate timeouts for content size:**
|
|
68
|
+
Examples:
|
|
469
69
|
|
|
470
70
|
```bash
|
|
471
|
-
|
|
472
|
-
llm
|
|
473
|
-
|
|
474
|
-
--output analysis.md
|
|
475
|
-
|
|
476
|
-
# Quick queries can use shorter timeouts
|
|
477
|
-
llm-query gflash "Simple question" --timeout 30
|
|
71
|
+
ace-llm codex:gpt@yolo "/as-assign-drive abc123@010" --interactive
|
|
72
|
+
ace-llm claude:sonnet "/as-assign-drive abc123@010" --interactive
|
|
73
|
+
ace-llm pi:zai/glm-4.7 "/as-assign-drive abc123@010" --interactive
|
|
478
74
|
```
|
|
479
75
|
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
**Choose providers based on task requirements:**
|
|
483
|
-
|
|
484
|
-
- **Analysis/Reasoning:** `anthropic:claude-sonnet-4-20250514`
|
|
485
|
-
- **Fast responses:** `google:gemini-2.5-flash`
|
|
486
|
-
- **Creative writing:** `google:gemini-2.5-pro`
|
|
487
|
-
- **General purpose:** `openai:gpt-4o`
|
|
76
|
+
Interactive mode still resolves aliases, presets, and translated skill prompts before launching the provider CLI.
|
|
488
77
|
|
|
489
|
-
###
|
|
78
|
+
### Exact provider reachability
|
|
490
79
|
|
|
491
|
-
|
|
80
|
+
Fallback is enabled by default. Use `--no-fallback` when you want the requested target to succeed or fail directly rather than routing through configured fallback providers.
|
|
492
81
|
|
|
493
|
-
|
|
494
|
-
# Debug API issues
|
|
495
|
-
llm-query provider:model "query" --debug --output result.md
|
|
496
|
-
```
|
|
497
|
-
|
|
498
|
-
**Use `--force` in automation:**
|
|
82
|
+
Examples:
|
|
499
83
|
|
|
500
84
|
```bash
|
|
501
|
-
|
|
502
|
-
llm
|
|
85
|
+
ace-llm gemini:pro "ping" --no-fallback --timeout 15 --max-tokens 4
|
|
86
|
+
ace-llm codex:mini "ping" --no-fallback --json --timeout 15 --max-tokens 4
|
|
503
87
|
```
|
|
504
88
|
|
|
505
|
-
##
|
|
506
|
-
|
|
507
|
-
### Common Issues
|
|
508
|
-
|
|
509
|
-
#### Authentication Errors
|
|
510
|
-
|
|
511
|
-
**Symptoms:**
|
|
512
|
-
|
|
513
|
-
- `401 Unauthorized` responses
|
|
514
|
-
- "Invalid API key" messages
|
|
515
|
-
- Authentication failures
|
|
89
|
+
## High-Value Options
|
|
516
90
|
|
|
517
|
-
|
|
91
|
+
| Option | Purpose |
|
|
92
|
+
|--------|---------|
|
|
93
|
+
| `--output FILE` | Write response output to a file |
|
|
94
|
+
| `--format text|json|markdown` | Control output formatting |
|
|
95
|
+
| `--system TEXT` / `--system-append TEXT` | Set or extend system instructions |
|
|
96
|
+
| `--preset NAME` | Apply an execution preset |
|
|
97
|
+
| `--model MODEL` | Override model for a provider or alias input |
|
|
98
|
+
| `--timeout SECONDS` | Limit request time |
|
|
99
|
+
| `--max-tokens INT` | Limit output length |
|
|
100
|
+
| `--interactive` | Launch native CLI mode for supported providers |
|
|
101
|
+
| `--json` | Emit structured command results |
|
|
102
|
+
| `--no-fallback` | Disable configured fallback routing for this call |
|
|
103
|
+
| `--list-providers` | Show active providers, models, and setup hints |
|
|
518
104
|
|
|
519
|
-
|
|
105
|
+
## Provider Notes
|
|
520
106
|
|
|
521
|
-
|
|
522
|
-
echo $GOOGLE_API_KEY
|
|
523
|
-
echo $ANTHROPIC_API_KEY
|
|
524
|
-
echo $OPENAI_API_KEY
|
|
525
|
-
```
|
|
107
|
+
### Google and Gemini families
|
|
526
108
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
109
|
+
- `google:*` targets API-backed Gemini models.
|
|
110
|
+
- `gemini:*` targets the Gemini CLI-backed provider from `ace-llm-providers-cli`.
|
|
111
|
+
- Current CLI alias examples:
|
|
112
|
+
- `gemini:flash-latest` -> `gemini:gemini-3-flash-preview`
|
|
113
|
+
- `gemini:pro-latest` -> `gemini:gemini-3.1-pro-preview`
|
|
530
114
|
|
|
531
|
-
|
|
115
|
+
### Codex and Claude families
|
|
532
116
|
|
|
533
|
-
|
|
117
|
+
- `codex` and `claude` support presets and thinking levels.
|
|
118
|
+
- `--interactive` launches their native terminal UI rather than one-shot execution.
|
|
534
119
|
|
|
535
|
-
|
|
536
|
-
- "Rate limit exceeded" messages
|
|
537
|
-
- Slow response times
|
|
120
|
+
### Provider discovery
|
|
538
121
|
|
|
539
|
-
|
|
122
|
+
Use `ace-llm --list-providers` as the canonical availability and setup check. The output includes active providers, model counts, inactive providers when filtered, and credential hints.
|
|
540
123
|
|
|
541
|
-
|
|
542
|
-
2. Use different providers for load distribution
|
|
543
|
-
3. Check API quotas and limits
|
|
544
|
-
4. Use lighter models for high-frequency requests
|
|
124
|
+
## Recommended Usage
|
|
545
125
|
|
|
546
|
-
|
|
126
|
+
- Prefer aliases for common workflows and explicit models for exact reproducibility.
|
|
127
|
+
- Use `--no-fallback` for diagnostics, setup checks, and doctor-style reachability tests.
|
|
128
|
+
- Use `--interactive` for agent-driving workflows and one-shot mode for scripting.
|
|
129
|
+
- Keep provider setup docs anchored on `ace-llm --list-providers` rather than hardcoded env-var lists when possible.
|
|
547
130
|
|
|
548
|
-
|
|
131
|
+
## Related Docs
|
|
549
132
|
|
|
550
|
-
-
|
|
551
|
-
-
|
|
552
|
-
-
|
|
553
|
-
|
|
554
|
-
**Solutions:**
|
|
555
|
-
|
|
556
|
-
1. Increase timeout for large content:
|
|
557
|
-
|
|
558
|
-
```bash
|
|
559
|
-
llm-query provider:model "large-content" --timeout 600
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
2. Split large content into smaller chunks
|
|
563
|
-
3. Use summarization for oversized inputs
|
|
564
|
-
4. Switch to higher-capacity models
|
|
565
|
-
|
|
566
|
-
#### File Output Issues
|
|
567
|
-
|
|
568
|
-
**Symptoms:**
|
|
569
|
-
|
|
570
|
-
- Cannot write to output file
|
|
571
|
-
- Permission denied errors
|
|
572
|
-
- File overwrite prompts
|
|
573
|
-
|
|
574
|
-
**Solutions:**
|
|
575
|
-
|
|
576
|
-
1. Check directory permissions
|
|
577
|
-
2. Use `--force` flag in automation
|
|
578
|
-
3. Verify output directory exists
|
|
579
|
-
4. Use absolute file paths
|
|
580
|
-
|
|
581
|
-
#### Provider Availability
|
|
582
|
-
|
|
583
|
-
**Symptoms:**
|
|
584
|
-
|
|
585
|
-
- Unknown provider errors
|
|
586
|
-
- Model not available messages
|
|
587
|
-
- Connection failures
|
|
588
|
-
|
|
589
|
-
**Solutions:**
|
|
590
|
-
|
|
591
|
-
1. Check provider status pages
|
|
592
|
-
2. Verify model names and availability
|
|
593
|
-
3. Use alternative providers as fallbacks
|
|
594
|
-
4. Check network connectivity
|
|
595
|
-
|
|
596
|
-
### Debugging Commands
|
|
597
|
-
|
|
598
|
-
**Get available providers and models:**
|
|
599
|
-
|
|
600
|
-
```bash
|
|
601
|
-
llm-query --help
|
|
602
|
-
```
|
|
603
|
-
|
|
604
|
-
**Test authentication:**
|
|
605
|
-
|
|
606
|
-
```bash
|
|
607
|
-
llm-query google "test" --debug
|
|
608
|
-
```
|
|
609
|
-
|
|
610
|
-
**Validate provider:model combinations:**
|
|
611
|
-
|
|
612
|
-
```bash
|
|
613
|
-
llm-query google:gemini-2.5-flash "validation test"
|
|
614
|
-
```
|
|
615
|
-
|
|
616
|
-
## Workflow Integration
|
|
617
|
-
|
|
618
|
-
### Review Code Workflow
|
|
619
|
-
|
|
620
|
-
The `llm-query` tool is used extensively in the review-code workflow:
|
|
621
|
-
|
|
622
|
-
**File:** `wfi://review/run`
|
|
623
|
-
|
|
624
|
-
**Usage Pattern:**
|
|
625
|
-
|
|
626
|
-
```bash
|
|
627
|
-
# Multi-Model LLM Execution (lines 331, 344)
|
|
628
|
-
llm-query google:gemini-2.5-pro \
|
|
629
|
-
"$(cat "${SESSION_DIR}/prompt.md")" \
|
|
630
|
-
--system "${SYSTEM_PROMPT_PATH}" \
|
|
631
|
-
--timeout 500 \
|
|
632
|
-
--output "${SESSION_DIR}/cr-report-gpro.md"
|
|
633
|
-
|
|
634
|
-
llm-query anthropic:claude-3-opus-20240229 \
|
|
635
|
-
"$(cat "${SESSION_DIR}/prompt.md")" \
|
|
636
|
-
--system "${SYSTEM_PROMPT_PATH}" \
|
|
637
|
-
--timeout 500 \
|
|
638
|
-
--output "${SESSION_DIR}/cr-report-opus.md"
|
|
639
|
-
```
|
|
640
|
-
|
|
641
|
-
### Handbook Review Command
|
|
642
|
-
|
|
643
|
-
**Canonical source:** `ace-handbook/handbook/skills/`
|
|
644
|
-
|
|
645
|
-
Provider integrations may project these canonical skill definitions into folders such as
|
|
646
|
-
`.claude/skills/`, but the source of truth lives under package `handbook/skills/` directories.
|
|
647
|
-
|
|
648
|
-
**Usage Pattern:**
|
|
649
|
-
|
|
650
|
-
```bash
|
|
651
|
-
# Pre-configured system prompt and parameters
|
|
652
|
-
system-prompt: dev-local/handbook/tpl/review/system.prompt.md
|
|
653
|
-
timeout: 500 seconds
|
|
654
|
-
output: Direct file output with cost tracking
|
|
655
|
-
```
|
|
656
|
-
|
|
657
|
-
### Template Files
|
|
658
|
-
|
|
659
|
-
**System Prompt Templates:**
|
|
660
|
-
|
|
661
|
-
- `tmpl://review-code/system`
|
|
662
|
-
- `tmpl://review-test/system`
|
|
663
|
-
- `tmpl://review-docs/system`
|
|
664
|
-
|
|
665
|
-
**Usage in Workflows:**
|
|
666
|
-
|
|
667
|
-
```bash
|
|
668
|
-
SYSTEM_PROMPT_PATH="tmpl://review-docs/system"
|
|
669
|
-
llm-query csonet "content" --system "${SYSTEM_PROMPT_PATH}"
|
|
670
|
-
```
|
|
671
|
-
|
|
672
|
-
## Related Documentation
|
|
673
|
-
|
|
674
|
-
- **Tool Source:** `llm-query`
|
|
675
|
-
|
|
676
|
-
- **Usage Examples:** `dev-tools/README.md`
|
|
677
|
-
|
|
678
|
-
## Version Information
|
|
679
|
-
|
|
680
|
-
This documentation covers the llm-query tool as of the current dev-tools implementation. For the latest features and updates, refer to the tool's help output:
|
|
681
|
-
```bash
|
|
682
|
-
llm-query --help
|
|
683
|
-
```
|
|
133
|
+
- [Usage Guide](../../docs/usage.md)
|
|
134
|
+
- [Getting Started](../../docs/getting-started.md)
|
|
135
|
+
- [Handbook Reference](../../docs/handbook.md)
|