llm_specs 0.1.6 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df786191fe1da5692c4400ec79daea67b246421a0644ffefd4da3d74922ddc9b
4
- data.tar.gz: 3b94ed5743d47eefc64ca36588de03aa2b74b20ecbb2cad711d47ef145d010d5
3
+ metadata.gz: c24274787a950d2423547ddd06869a47e4f2b2c3b0b721f7abe141efea300d95
4
+ data.tar.gz: edeb2f59d249b951e8c8c6e19d6caa289c22c1055eba5ef813270838ffc560fe
5
5
  SHA512:
6
- metadata.gz: d1b0d63b025a623332540715e48ea5abe9afd5d522146c622f5721b13ee5dfa27aae060a2025136a303f50311894a3c8ed6467eca8128353f3ff3afd3d7c95ae
7
- data.tar.gz: 2407bcb8f920e87a6376558e95c2e8235248df624b7f4ae0abc7220aed342c1dfd3376166b5b4e24503ba2a66ec968ea03230be38674e656d398b563dab328dd
6
+ metadata.gz: 0ce566d5d907459e7250bc292f5eda9d6d5e13a82c97bc949838eaa49411d16dbfddf0017805099a2c0f256be718149526807f914bdebedd2bbb41801e85b52d
7
+ data.tar.gz: a450a7b8b9253abc24d0dc17418cde60bf8da02c92f29d4964c9dfd60fad7cacb3a582c269ebf54436023dd8d514aa1f5f52d14fbff8f3cce699059703b47b10
data/README.md CHANGED
@@ -7,7 +7,7 @@ It provides a simple, efficient way to access model metadata with built-in cachi
7
7
  ## Features
8
8
 
9
9
  - Fetches LLM specs from: https://api.parsera.org/v1/llm-specs
10
- - Caches results locally to models.json
10
+ - Caches results locally to llm-specs.json
11
11
  - Provides a queryable catalog of models via .models
12
12
  - Supports filtering and lookup by model attributes
13
13
 
@@ -8,7 +8,7 @@ module LLMSpecs
8
8
 
9
9
  def fetch
10
10
  return read if valid?
11
- yield.tap { write(it) }
11
+ yield.tap { write it }
12
12
  end
13
13
 
14
14
  def valid?
@@ -2,7 +2,7 @@
2
2
  module LLMSpecs
3
3
  class Collection < Array
4
4
  def find(id)
5
- super() { it.id == id } || raise(ModelNotFound.new(id))
5
+ super() { it.id == id } or raise ModelNotFound.new(id)
6
6
  end
7
7
 
8
8
  def where(**criteria)
@@ -13,7 +13,7 @@ module LLMSpecs
13
13
 
14
14
  %i[select reject filter].each do |method|
15
15
  define_method(method) do |&block|
16
- self.class.new(super(&block))
16
+ self.class.new super(&block)
17
17
  end
18
18
  end
19
19
  end
@@ -2,7 +2,7 @@
2
2
  module LLMSpecs
3
3
  class ModelNotFound < StandardError
4
4
  def initialize(id)
5
- super("Couldn't find model with id='#{id}'")
5
+ super "Couldn't find model with id='#{id}'"
6
6
  end
7
7
  end
8
8
  end
@@ -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?(*caps)
5
- caps.all? { capabilities.include?(it.to_s) }
4
+ def supports?(*args)
5
+ args.all? { capabilities.include? it.to_s }
6
6
  end
7
7
 
8
- def supports_input?(*modes)
9
- modes.all? { input_modalities.include?(it.to_s) }
8
+ def supports_input?(*args)
9
+ args.all? { input_modalities.include? it.to_s }
10
10
  end
11
11
 
12
- def supports_output?(*modes)
13
- modes.all? { output_modalities.include?(it.to_s) }
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?(capability) }
17
+ define_method(:"#{capability}?") { supports? capability }
18
18
  end
19
19
 
20
- %i[text image audio].each do |method|
21
- define_method(:"#{method}_input?") { supports_input?(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 |method|
25
- define_method(:"#{method}_output?") { supports_output?(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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module LLMSpecs
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.8"
4
4
  end
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.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Power