ask-llm-providers 0.12.2 → 0.13.0
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/CHANGELOG.md +6 -0
- data/README.md +8 -7
- data/lib/ask/llm/models/commandcode.json +79 -0
- data/lib/ask/llm/models/opencode.json +46 -0
- data/lib/ask/llm/openai_compatible.rb +3 -0
- data/lib/ask/llm/version.rb +1 -1
- data/lib/ask/provider/openai.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21bdd0c1e8eff95ab87d08d7fcf6f8d47c167eb69af811d48ffdb679fb0cec2a
|
|
4
|
+
data.tar.gz: e87408f08fd1fdc3659a91a31894c607326cd7487ae2fc7af122897091e1df79
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0df5da10dc8be6318024b3488d5c9b72b2c544ab0d871a5d294a6d77f2eb4bce832bffb1e3493a0e255ec3c535cab43318051f5aca9bd74c81f8f9715f2bfe9a
|
|
7
|
+
data.tar.gz: 97ea51fde1c1d650151120b4ae6f6edcb48b2773ae230b21046ab292906ba7bd104035413c795ef6a959bc872f1bf3dc738188b05fff03b61aaf340dcaa9fe49
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [0.13.0] — 2026-09-05
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- **Command Code provider entry + models.** `commandcode` in the OpenAI-compatible registry (`https://api.commandcode.ai/provider/v1`, env `COMMANDCODE_API_KEY`) plus catalog models: mimo-v2.5, mimo-v2.5-pro, deepseek/deepseek-v4-flash, deepseek/deepseek-v4-pro, qwen/qwen3.8-27b, claude-sonnet-4-6, and gpt-5.6-luna (flat-rate, riding the user's Command Code plan).
|
|
6
|
+
|
|
1
7
|
## [0.11.1] — 2026-08-07
|
|
2
8
|
|
|
3
9
|
### Added
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All LLM providers for the ask-rb ecosystem in one gem. Implements the
|
|
4
4
|
`Ask::Provider` interface from `ask-core` with a capabilities-based interface:
|
|
5
|
-
7 canonical provider classes plus
|
|
5
|
+
7 canonical provider classes plus 27 OpenAI-compatible registry entries,
|
|
6
6
|
a bundled model catalog, and cost calculation. Providers auto-register and
|
|
7
7
|
the model catalog auto-loads when the gem is required.
|
|
8
8
|
|
|
@@ -39,25 +39,26 @@ model.capabilities # => ["chat", "streaming", "tool_calls", ...]
|
|
|
39
39
|
| Ollama (local) | none needed |
|
|
40
40
|
| Mistral AI | `Ask::Auth.resolve(:mistral_api_key)` (env `MISTRAL_API_KEY`) |
|
|
41
41
|
| Cloudflare Workers AI | `Ask::Auth.resolve(:cloudflare_api_key)` (env `CLOUDFLARE_API_KEY`) |
|
|
42
|
-
|
|
|
42
|
+
| 27 OpenAI-compatible | per-provider `*_API_KEY` env var (e.g. `DEEPSEEK_API_KEY`, `GROQ_API_KEY`, `OPENROUTER_API_KEY`) |
|
|
43
43
|
|
|
44
44
|
Credentials resolve through `Ask::Auth` in order: environment variables,
|
|
45
45
|
`~/.ask/credentials.yml`, Rails credentials, then database and OAuth
|
|
46
46
|
providers. Keys are read via `Ask::Auth.resolve(:<name>_api_key)`.
|
|
47
47
|
|
|
48
|
-
The
|
|
48
|
+
The 27 OpenAI-compatible entries are registered from
|
|
49
49
|
`Ask::LLM::OPENAI_COMPATIBLE`: DeepSeek, Groq, Together, Fireworks, Cerebras,
|
|
50
50
|
xAI, Perplexity, DeepInfra, Anyscale, SambaNova, Nebius, Nvidia NIM, Friendli,
|
|
51
51
|
Hyperbolic, Novita, Nscale, Featherless, AI/ML API, AI21, Meta, GitHub Models,
|
|
52
|
-
OpenRouter, OpenCode, OpenCode Go, Mimo, and
|
|
52
|
+
OpenRouter, OpenCode, OpenCode Go, Mimo, Moonshot, and Command Code. Each uses its own
|
|
53
53
|
`*_API_KEY` env var; note that `opencode_go` uses `OPENCODE_GO_API_KEY` (its
|
|
54
54
|
own key, not `OPENCODE_API_KEY`).
|
|
55
55
|
|
|
56
56
|
## Model Catalog
|
|
57
57
|
|
|
58
58
|
The gem bundles model metadata (capabilities, pricing, context windows,
|
|
59
|
-
modalities) as JSON for
|
|
60
|
-
bedrock, deepseek, mistral, perplexity, xai, meta, moonshot,
|
|
59
|
+
modalities) as JSON for 16 providers: openai, anthropic, gemini, vertex_ai,
|
|
60
|
+
bedrock, deepseek, mistral, perplexity, xai, meta, moonshot, nvidia_nim,
|
|
61
|
+
github_copilot, openai_codex, opencode, and commandcode,
|
|
61
62
|
with 400+ models in total.
|
|
62
63
|
|
|
63
64
|
```ruby
|
|
@@ -72,7 +73,7 @@ Ask::ModelCatalog.refresh! # fetch latest from models.dev
|
|
|
72
73
|
| API | Purpose |
|
|
73
74
|
|---|---|
|
|
74
75
|
| `Ask::Providers::OpenAI/Anthropic/Google/Bedrock/Ollama/Mistral/Cloudflare` | Canonical provider classes |
|
|
75
|
-
| `Ask::LLM::OPENAI_COMPATIBLE` | Registry data for the
|
|
76
|
+
| `Ask::LLM::OPENAI_COMPATIBLE` | Registry data for the 27 compatible providers |
|
|
76
77
|
| `Ask::LLM::Catalog.load!` / `refresh!` | Load bundled + user model data into `Ask::ModelCatalog` |
|
|
77
78
|
| `Ask::LLM::Aliases.resolve("claude-sonnet-4")` | Short-name to canonical model ID resolution |
|
|
78
79
|
| `Ask::LLM::CostCalculator.calculate(model, input_tokens:, output_tokens:)` | USD cost from model pricing |
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "deepseek/deepseek-v4-flash",
|
|
4
|
+
"name": "DeepSeek V4 Flash",
|
|
5
|
+
"family": "deepseek_v4",
|
|
6
|
+
"provider": "commandcode",
|
|
7
|
+
"context_window": 1000000,
|
|
8
|
+
"max_output_tokens": 128000,
|
|
9
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
10
|
+
"modalities": {"input": ["text"], "output": ["text"]},
|
|
11
|
+
"pricing": {"input": 0, "output": 0}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "deepseek/deepseek-v4-pro",
|
|
15
|
+
"name": "DeepSeek V4 Pro",
|
|
16
|
+
"family": "deepseek_v4",
|
|
17
|
+
"provider": "commandcode",
|
|
18
|
+
"context_window": 1000000,
|
|
19
|
+
"max_output_tokens": 128000,
|
|
20
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
21
|
+
"modalities": {"input": ["text"], "output": ["text"]},
|
|
22
|
+
"pricing": {"input": 0, "output": 0}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "qwen/qwen3.8-27b",
|
|
26
|
+
"name": "Qwen3.8 27B",
|
|
27
|
+
"family": "qwen3",
|
|
28
|
+
"provider": "commandcode",
|
|
29
|
+
"context_window": 1000000,
|
|
30
|
+
"max_output_tokens": 128000,
|
|
31
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
32
|
+
"modalities": {"input": ["text"], "output": ["text"]},
|
|
33
|
+
"pricing": {"input": 0, "output": 0}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "mimo-v2.5",
|
|
37
|
+
"name": "Mimo V2.5",
|
|
38
|
+
"family": "mimo",
|
|
39
|
+
"provider": "commandcode",
|
|
40
|
+
"context_window": 1000000,
|
|
41
|
+
"max_output_tokens": 128000,
|
|
42
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
43
|
+
"modalities": {"input": ["text", "image", "audio", "video"], "output": ["text"]},
|
|
44
|
+
"pricing": {"input": 0, "output": 0}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "mimo-v2.5-pro",
|
|
48
|
+
"name": "Mimo V2.5 Pro",
|
|
49
|
+
"family": "mimo",
|
|
50
|
+
"provider": "commandcode",
|
|
51
|
+
"context_window": 1000000,
|
|
52
|
+
"max_output_tokens": 128000,
|
|
53
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
54
|
+
"modalities": {"input": ["text", "image"], "output": ["text"]},
|
|
55
|
+
"pricing": {"input": 0, "output": 0}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "claude-sonnet-4-6",
|
|
59
|
+
"name": "Claude Sonnet 4.6",
|
|
60
|
+
"family": "claude_sonnet",
|
|
61
|
+
"provider": "commandcode",
|
|
62
|
+
"context_window": 200000,
|
|
63
|
+
"max_output_tokens": 64000,
|
|
64
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
65
|
+
"modalities": {"input": ["text", "image"], "output": ["text"]},
|
|
66
|
+
"pricing": {"input": 0, "output": 0}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "gpt-5.6-luna",
|
|
70
|
+
"name": "GPT-5.6 Luna",
|
|
71
|
+
"family": "gpt",
|
|
72
|
+
"provider": "commandcode",
|
|
73
|
+
"context_window": 1000000,
|
|
74
|
+
"max_output_tokens": 128000,
|
|
75
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
76
|
+
"modalities": {"input": ["text", "image"], "output": ["text"]},
|
|
77
|
+
"pricing": {"input": 0, "output": 0}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "deepseek-v4-flash",
|
|
4
|
+
"name": "DeepSeek V4 Flash",
|
|
5
|
+
"family": "deepseek_v4",
|
|
6
|
+
"provider": "opencode",
|
|
7
|
+
"context_window": 1000000,
|
|
8
|
+
"max_output_tokens": 384000,
|
|
9
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
10
|
+
"modalities": {"input": ["text"], "output": ["text"]},
|
|
11
|
+
"pricing": {"input": 0, "output": 0}
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "deepseek-v4-flash",
|
|
15
|
+
"name": "DeepSeek V4 Flash",
|
|
16
|
+
"family": "deepseek_v4",
|
|
17
|
+
"provider": "opencode_go",
|
|
18
|
+
"context_window": 1000000,
|
|
19
|
+
"max_output_tokens": 384000,
|
|
20
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
21
|
+
"modalities": {"input": ["text"], "output": ["text"]},
|
|
22
|
+
"pricing": {"input": 0, "output": 0}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "mimo-v2.5",
|
|
26
|
+
"name": "Mimo V2.5",
|
|
27
|
+
"family": "mimo",
|
|
28
|
+
"provider": "opencode",
|
|
29
|
+
"context_window": 1000000,
|
|
30
|
+
"max_output_tokens": 384000,
|
|
31
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
32
|
+
"modalities": {"input": ["text"], "output": ["text"]},
|
|
33
|
+
"pricing": {"input": 0, "output": 0}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "mimo-v2.5",
|
|
37
|
+
"name": "Mimo V2.5",
|
|
38
|
+
"family": "mimo",
|
|
39
|
+
"provider": "opencode_go",
|
|
40
|
+
"context_window": 1000000,
|
|
41
|
+
"max_output_tokens": 384000,
|
|
42
|
+
"capabilities": ["function_calling", "streaming", "reasoning"],
|
|
43
|
+
"modalities": {"input": ["text"], "output": ["text"]},
|
|
44
|
+
"pricing": {"input": 0, "output": 0}
|
|
45
|
+
}
|
|
46
|
+
]
|
|
@@ -23,6 +23,9 @@ module Ask
|
|
|
23
23
|
cerebras: { api_base: "https://api.cerebras.ai/v1", api_key_env: "CEREBRAS_API_KEY",
|
|
24
24
|
capabilities: { chat: true, streaming: true, tool_calls: true } },
|
|
25
25
|
|
|
26
|
+
commandcode: { api_base: "https://api.commandcode.ai/provider/v1", api_key_env: "COMMANDCODE_API_KEY",
|
|
27
|
+
capabilities: { chat: true, streaming: true, tool_calls: true } },
|
|
28
|
+
|
|
26
29
|
deepinfra: { api_base: "https://api.deepinfra.com/v1/openai", api_key_env: "DEEPINFRA_API_KEY",
|
|
27
30
|
capabilities: { chat: true, streaming: true, tool_calls: true } },
|
|
28
31
|
|
data/lib/ask/llm/version.rb
CHANGED
data/lib/ask/provider/openai.rb
CHANGED
|
@@ -422,7 +422,7 @@ module Ask
|
|
|
422
422
|
end
|
|
423
423
|
|
|
424
424
|
def build_http
|
|
425
|
-
LLM::HTTP.connection(api_base, headers:, request: { open_timeout: 30, timeout:
|
|
425
|
+
LLM::HTTP.connection(api_base, headers:, request: { open_timeout: 30, timeout: 600 })
|
|
426
426
|
end
|
|
427
427
|
|
|
428
428
|
def format_messages(messages)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ask-llm-providers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kaka Ruto
|
|
@@ -184,6 +184,7 @@ files:
|
|
|
184
184
|
- lib/ask/llm/http.rb
|
|
185
185
|
- lib/ask/llm/models/anthropic.json
|
|
186
186
|
- lib/ask/llm/models/bedrock.json
|
|
187
|
+
- lib/ask/llm/models/commandcode.json
|
|
187
188
|
- lib/ask/llm/models/deepseek.json
|
|
188
189
|
- lib/ask/llm/models/gemini.json
|
|
189
190
|
- lib/ask/llm/models/github_copilot.json
|
|
@@ -193,6 +194,7 @@ files:
|
|
|
193
194
|
- lib/ask/llm/models/nvidia_nim.json
|
|
194
195
|
- lib/ask/llm/models/openai.json
|
|
195
196
|
- lib/ask/llm/models/openai_codex.json
|
|
197
|
+
- lib/ask/llm/models/opencode.json
|
|
196
198
|
- lib/ask/llm/models/perplexity.json
|
|
197
199
|
- lib/ask/llm/models/vertex_ai.json
|
|
198
200
|
- lib/ask/llm/models/xai.json
|