llm_specs 0.1.2 → 0.1.4
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/version.rb +1 -1
- data/lib/llm_specs.rb +11 -4
- 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: 4604604399ad4ef7ff18abb3c93064b17a1d6e2fa068e5b6204b1bf7c4303b68
|
4
|
+
data.tar.gz: 6592a5f8cdaed54ff6688a846d979ff7b41bdfe94f4a9b1144fa29714b61205c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fae24b7964fef5f7533c905e061f12d83f9b7817b1e3b769ad8a27dfcd2292135e4d9eac4637b389de9f006a4d103b2f4b3c7ead7f59122cea15656d58fb8eb7
|
7
|
+
data.tar.gz: 749105c92098bc6105c2e7e28d8def9a9d44fb7eb3cd40da77e1e747fd5c3f3017307ca479bc3badcd5ff106b6eb31b428afebab68576c0d009992d4efe64f03
|
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/version.rb
CHANGED
data/lib/llm_specs.rb
CHANGED
@@ -9,10 +9,17 @@ require_relative "llm_specs/collection"
|
|
9
9
|
require_relative "llm_specs/model"
|
10
10
|
|
11
11
|
module LLMSpecs
|
12
|
-
API_URI
|
13
|
-
CACHE_PATH = "models.json"
|
12
|
+
API_URI = "https://api.parsera.org/v1/llm-specs"
|
14
13
|
|
15
|
-
|
16
|
-
|
14
|
+
class << self
|
15
|
+
attr_writer :cache_path
|
16
|
+
|
17
|
+
def cache_path
|
18
|
+
@cache_path || "llm-specs.json"
|
19
|
+
end
|
20
|
+
|
21
|
+
def models
|
22
|
+
@models ||= Catalog.new(api_uri: API_URI, cache_path: cache_path).models
|
23
|
+
end
|
17
24
|
end
|
18
25
|
end
|