llm_specs 0.1.3 → 0.1.5
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 +20 -13
- data/lib/llm_specs/cache.rb +1 -3
- data/lib/llm_specs/catalog.rb +7 -3
- data/lib/llm_specs/errors.rb +0 -8
- data/lib/llm_specs/version.rb +1 -1
- data/lib/llm_specs.rb +1 -1
- metadata +1 -2
- data/models.json +0 -4031
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79037b669b30677efe9d924a7b8083f426f943f54d66ea975de9e3b9757bc85f
|
4
|
+
data.tar.gz: d778a3d458ef032b79cf451a6c1ccfd28ba8aac22472613c7535153bed8f4498
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef501f8bdc9550691ce68b124d047115bb66c3c14b0ee73a4bd49405d05be00ed03d021f9afb25f51c26a11378c2220be1dc57fd16d8ce423a19e396571b7a50
|
7
|
+
data.tar.gz: 791ea85d4793569859f2389fbbfd0ecf847a365f2e1004805fff5410b60cda2234fa2588fbf7fc54a17e4708dbd642aa1dfc5c36b9bacd636d777573745bd165
|
data/README.md
CHANGED
@@ -66,27 +66,34 @@ model.supports?(:function_calling, :batch) # => true/false
|
|
66
66
|
|
67
67
|
or input or output modalities:
|
68
68
|
```ruby
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
69
|
+
model.supports_input?(:audio) # => true/false
|
70
|
+
model.supports_input?(:audio, :text) # multiple argument
|
71
|
+
model.audio_input? # shortcut
|
72
|
+
model.image_input?
|
73
|
+
model.text_input?
|
74
|
+
|
75
|
+
model.supports_output?(:audio) # => true/false
|
76
|
+
model.supports_output?(:audio, :embeddings) # multiple argument
|
77
|
+
model.audio_output? # shortcut
|
78
|
+
model.image_output?
|
79
|
+
model.text_output?
|
80
|
+
model.embeddings_output?
|
81
81
|
```
|
82
82
|
|
83
83
|
Pricing methods:
|
84
84
|
```ruby
|
85
|
-
model.input_pricing # => $ per 1M input tokens (default :text_tokens)
|
85
|
+
model.input_pricing # 1.1 => $ per 1M input tokens (default :text_tokens)
|
86
|
+
model.output_pricing
|
87
|
+
|
86
88
|
model.input_pricing(:text_tokens, :batch)
|
87
89
|
model.output_pricing(:embeddings)
|
88
90
|
```
|
89
91
|
|
92
|
+
## Cache configuration
|
93
|
+
|
94
|
+
```ruby
|
95
|
+
LLMSpecs.cache_path = Rails.root.join("tmp", "cache", "llm-specs-cache.json")
|
96
|
+
```
|
90
97
|
|
91
98
|
## License
|
92
99
|
|
data/lib/llm_specs/cache.rb
CHANGED
data/lib/llm_specs/catalog.rb
CHANGED
@@ -14,10 +14,14 @@ module LLMSpecs
|
|
14
14
|
|
15
15
|
def fetch
|
16
16
|
@cache.fetch do
|
17
|
-
|
18
|
-
raise FetchError.new(response) unless response.is_a? Net::HTTPSuccess
|
19
|
-
JSON.parse(response.body, symbolize_names: true)
|
17
|
+
parse Net::HTTP.get_response(@uri).tap(&:value) # raises Net::HTTPError if not 2xx
|
20
18
|
end
|
21
19
|
end
|
20
|
+
|
21
|
+
def parse(response)
|
22
|
+
JSON.parse(response.body, symbolize_names: true)
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
26
|
+
|
27
|
+
|
data/lib/llm_specs/errors.rb
CHANGED
@@ -5,12 +5,4 @@ module LLMSpecs
|
|
5
5
|
super("Couldn't find model with id='#{id}'")
|
6
6
|
end
|
7
7
|
end
|
8
|
-
|
9
|
-
class FetchError < StandardError
|
10
|
-
attr_reader :response
|
11
|
-
def initialize(response)
|
12
|
-
@response = response
|
13
|
-
super("HTTP fetch failed (status: #{response.status})")
|
14
|
-
end
|
15
|
-
end
|
16
8
|
end
|
data/lib/llm_specs/version.rb
CHANGED
data/lib/llm_specs.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: llm_specs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Power
|
@@ -43,7 +43,6 @@ files:
|
|
43
43
|
- lib/llm_specs/errors.rb
|
44
44
|
- lib/llm_specs/model.rb
|
45
45
|
- lib/llm_specs/version.rb
|
46
|
-
- models.json
|
47
46
|
- sig/llm_specs.rbs
|
48
47
|
homepage: https://github.com/max-power/llm_specs
|
49
48
|
licenses:
|