llm_specs 0.1.7 → 0.1.9
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/README.md +10 -1
- data/lib/llm_specs/errors.rb +1 -1
- data/lib/llm_specs/model.rb +11 -11
- data/lib/llm_specs/version.rb +1 -1
- data/lib/llm_specs.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81de36354efcb2d8856d761c6e773ab49e7056d22360695f768bd346ed044958
|
4
|
+
data.tar.gz: f5ad326858cb9e75cea2ff30edc38ddccf5838fb2660f819a69bfbe82d232129
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d11e01888a0e88d5fb129fba566992f12ba6ee9a173fa3584786406bf8927e2c48ada1e4843d1685006096ef525c5c61721c0b4d5a50ede9aed73b21ebb9841
|
7
|
+
data.tar.gz: 7855d013340c075965cfa83adaaa4d656710f77ebe8cd24927cfb10600b06da10da029d347b883fda58954bbaa1e3ed0265cee22b80e1292edb63200a9e2f991
|
data/README.md
CHANGED
@@ -16,7 +16,12 @@ It provides a simple, efficient way to access model metadata with built-in cachi
|
|
16
16
|
```ruby
|
17
17
|
require 'llm_specs'
|
18
18
|
|
19
|
-
models = LLMSpecs.models
|
19
|
+
models = LLMSpecs.models # all models
|
20
|
+
|
21
|
+
models = LLMSpecs.gemini # provider specific models
|
22
|
+
models = LLMSpecs.anthropic
|
23
|
+
models = LLMSpecs.openai
|
24
|
+
models = LLMSpecs.deepseek
|
20
25
|
```
|
21
26
|
|
22
27
|
### Find a model by ID
|
@@ -28,9 +33,13 @@ model = LLMSpecs.models.find("claude-3-sonnet")
|
|
28
33
|
```ruby
|
29
34
|
# List all Anthropic models
|
30
35
|
anthropic_models = LLMSpecs.models.where(provider: "anthropic")
|
36
|
+
# or
|
37
|
+
anthropic_models = LLMSpecs.anthropic
|
31
38
|
|
32
39
|
# List all Anthropic models by family "claude-3-7-sonnet"
|
33
40
|
claude_models = LLMSpecs.models.where(provider: "anthropic", family: "claude-3-7-sonnet")
|
41
|
+
#or
|
42
|
+
claude_models = LLMSpecs.anthropic.where(family: "claude-3-7-sonnet")
|
34
43
|
|
35
44
|
# List all models that support streaming
|
36
45
|
streaming_models = LLMSpecs.models.select(&:streaming?)
|
data/lib/llm_specs/errors.rb
CHANGED
data/lib/llm_specs/model.rb
CHANGED
@@ -1,28 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
module LLMSpecs
|
3
3
|
class Model < Data.define(:id, :name, :provider, :family, :context_window, :max_output_tokens, :modalities, :capabilities, :pricing)
|
4
|
-
def supports?(*
|
5
|
-
|
4
|
+
def supports?(*args)
|
5
|
+
args.all? { capabilities.include? it.to_s }
|
6
6
|
end
|
7
7
|
|
8
|
-
def supports_input?(*
|
9
|
-
|
8
|
+
def supports_input?(*args)
|
9
|
+
args.all? { input_modalities.include? it.to_s }
|
10
10
|
end
|
11
11
|
|
12
|
-
def supports_output?(*
|
13
|
-
|
12
|
+
def supports_output?(*args)
|
13
|
+
args.all? { output_modalities.include? it.to_s }
|
14
14
|
end
|
15
15
|
|
16
16
|
%i[function_calling structured_output batch reasoning citations streaming].each do |capability|
|
17
|
-
define_method(:"#{capability}?") { supports?
|
17
|
+
define_method(:"#{capability}?") { supports? capability }
|
18
18
|
end
|
19
19
|
|
20
|
-
%i[text image audio].each do |
|
21
|
-
define_method(:"#{
|
20
|
+
%i[text image audio].each do |mode|
|
21
|
+
define_method(:"#{mode}_input?") { supports_input? mode }
|
22
22
|
end
|
23
23
|
|
24
|
-
%i[text image audio embeddings].each do |
|
25
|
-
define_method(:"#{
|
24
|
+
%i[text image audio embeddings].each do |mode|
|
25
|
+
define_method(:"#{mode}_output?") { supports_output? mode }
|
26
26
|
end
|
27
27
|
|
28
28
|
def input_modalities
|
data/lib/llm_specs/version.rb
CHANGED
data/lib/llm_specs.rb
CHANGED