rubric_llm 0.6.0 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1129b7b842324735b232caf6a116451cb04b599187aac713ce20c5befda4295
4
- data.tar.gz: 33fc34b74d756ded10b00227cc9c46de94aa3da8a17dd798dc49e94edee5ba15
3
+ metadata.gz: 3f75b6e37c79f540f62929562809323154ab17055a6e1f6b74c918605dd3f4c0
4
+ data.tar.gz: 9a4a7752bf87c1e16e4d75ff190d5a45f9c368276cb47a7c148be2c873de9e35
5
5
  SHA512:
6
- metadata.gz: 19c150856bbb65ab6d1c85e0a80ab92c309fc4524f20ab2057323715f6dd506d24408e37263e37b13eb0d3b6410f7c56a47a2511cbb25d5d0a1d53872117e4ab
7
- data.tar.gz: e3c83d54f10befc47c0a403f9784f33a634debae737201cf39b758784bc3a0c1f6760a08aab677d00c101eab6a5b67ee8d05626a39360d1d68fea5ab1304c767
6
+ metadata.gz: 3606120936454d38b72f5441ef3329a645a3dd725148728fe3e3b45e595c76028d02aeab176767ec93bacae330709ec9ad1bdff57f06ac4942ddda89a518ad5b
7
+ data.tar.gz: 667739e0ee4e4568faf3f438b9b3b4455fcd9d7fb0815e2575f172d8e91abb33c7a03fe9f4b436f14cc0a35614c9ce604d23c1d509befaf62e0a023b81aa107c
data/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.7.0] - 2026-09-22
9
+
10
+ ### Added
11
+
12
+ - Optional `thinking_effort` configuration and `RUBRIC_THINKING_EFFORT` environment variable for judge reasoning models, passed to RubyLLM's `with_thinking(effort: ...)`. The default leaves thinking controls unchanged; explicit `nil` ignores the environment variable
13
+
8
14
  ## [0.6.0] - 2026-09-18
9
15
 
10
16
  ### Changed
data/README.md CHANGED
@@ -8,14 +8,14 @@ Lightweight LLM evaluation framework for Ruby, inspired by [DeepEval](https://gi
8
8
 
9
9
  Provider-agnostic evaluation with pluggable metrics, statistical A/B comparison, and test framework integration: no Rails, no ActiveRecord, no UI. Works anywhere Ruby runs.
10
10
 
11
- RubricLLM `0.6.0` supports RubyLLM `~> 2.0` and Ruby 3.4 or later. Applications that use RubyLLM 1.x should stay on RubricLLM `0.5.x`.
11
+ RubricLLM `0.7.0` supports RubyLLM `~> 2.0` and Ruby 3.4 or later. Applications that use RubyLLM 1.x should stay on RubricLLM `0.5.x`.
12
12
 
13
13
  ## Installation
14
14
 
15
15
  Update both gem constraints together:
16
16
 
17
17
  ```ruby
18
- gem "rubric_llm", "~> 0.6.0"
18
+ gem "rubric_llm", "~> 0.7.0"
19
19
  gem "ruby_llm", "~> 2.0"
20
20
  ```
21
21
 
@@ -30,7 +30,7 @@ If the application still has a RubyLLM 1.x constraint, update both constraints b
30
30
  Or install directly:
31
31
 
32
32
  ```bash
33
- gem install rubric_llm --version 0.6.0
33
+ gem install rubric_llm --version 0.7.0
34
34
  ```
35
35
 
36
36
  ## Quick Start
@@ -92,6 +92,28 @@ end
92
92
 
93
93
  Structured output support depends on the selected provider and model. RubricLLM sends its schema when RubyLLM reports structured output support. Otherwise it requests JSON text and validates the response object and score locally. Check the target provider's support before relying on a schema or a specific protocol. See RubyLLM's [2.0 upgrade guide](https://rubyllm.com/next/upgrading/), [request control guide](https://rubyllm.com/next/chat-request-control/), and [structured output support](https://rubyllm.com/next/structured-output/).
94
94
 
95
+ ### Judge Thinking Effort
96
+
97
+ Set `thinking_effort` when using a reasoning model to control the trade-off between judge quality, latency, and cost:
98
+
99
+ ```ruby
100
+ RubricLLM.configure do |c|
101
+ c.judge_model = "gpt-6-astra"
102
+ c.judge_provider = :openai
103
+ c.temperature = nil
104
+ c.thinking_effort = :high
105
+ end
106
+
107
+ # Or configure an individual evaluation:
108
+ config = RubricLLM::Config.new(judge_model: "gpt-6-astra", temperature: nil, thinking_effort: "high")
109
+ ```
110
+
111
+ RubricLLM passes the value to RubyLLM's [`with_thinking(effort: ...)`](https://rubyllm.com/thinking/). Strings and symbols are accepted. Supported values depend on the model and provider; RubricLLM does not translate values or silently ignore unsupported settings. Request errors are reported as judge errors.
112
+
113
+ The default is `nil`: RubricLLM does not call `with_thinking`, so existing RubyLLM and provider behavior is unchanged. This does **not** disable reasoning. An omitted setting reads `RUBRIC_THINKING_EFFORT`; an explicit `thinking_effort: nil` ignores that environment variable. Use `:none` only when the selected model supports it.
114
+
115
+ Higher effort does not guarantee better scores. Compare results on your evaluation dataset. For providers that count reasoning tokens toward the output limit, increase `max_tokens` if the default 4,096 tokens leaves too little room for the JSON response.
116
+
95
117
  ### Environment Variables
96
118
 
97
119
  All config fields can be set via environment variables:
@@ -101,6 +123,7 @@ All config fields can be set via environment variables:
101
123
  | `RUBRIC_JUDGE_MODEL` | `gpt-4o` | Judge LLM model name |
102
124
  | `RUBRIC_JUDGE_PROVIDER` | `openai` | RubyLLM provider |
103
125
  | `RUBRIC_TEMPERATURE` | `0.0` | Judge temperature |
126
+ | `RUBRIC_THINKING_EFFORT` | unset | Model-specific reasoning effort, such as `high` |
104
127
  | `RUBRIC_MAX_TOKENS` | `4096` | Max response tokens |
105
128
  | `RUBRIC_MAX_RETRIES` | `2` | Max retries on transient failures |
106
129
  | `RUBRIC_RETRY_BASE_DELAY` | `1.0` | Base delay (seconds) for exponential backoff |
@@ -403,7 +426,7 @@ Deep dives live in the [project wiki](https://github.com/dpaluy/rubric_llm/wiki)
403
426
  ## Requirements
404
427
 
405
428
  - Ruby >= 3.4
406
- - [ruby_llm](https://github.com/crmne/ruby_llm) ~> 2.0 for RubricLLM 0.6.0
429
+ - [ruby_llm](https://github.com/crmne/ruby_llm) ~> 2.0 for RubricLLM 0.7.0
407
430
  - An API key for your chosen LLM provider (set via RubyLLM configuration)
408
431
 
409
432
  ## Contributing
@@ -3,14 +3,16 @@
3
3
  module RubricLLM
4
4
  class Config
5
5
  attr_accessor :judge_model, :judge_provider, :temperature, :max_tokens, :custom_prompt,
6
- :max_retries, :retry_base_delay, :concurrency
6
+ :max_retries, :retry_base_delay, :concurrency, :thinking_effort
7
7
 
8
8
  def initialize(judge_model: nil, judge_provider: nil, # rubocop:disable Metrics/ParameterLists
9
9
  temperature: Float(ENV.fetch("RUBRIC_TEMPERATURE", "0.0")), max_tokens: nil,
10
- custom_prompt: nil, max_retries: nil, retry_base_delay: nil, concurrency: nil, validate: false)
10
+ custom_prompt: nil, max_retries: nil, retry_base_delay: nil, concurrency: nil, validate: false,
11
+ thinking_effort: ENV.fetch("RUBRIC_THINKING_EFFORT", nil))
11
12
  @judge_model = judge_model || ENV.fetch("RUBRIC_JUDGE_MODEL", "gpt-4o")
12
13
  @judge_provider = (judge_provider || ENV.fetch("RUBRIC_JUDGE_PROVIDER", "openai")).to_sym
13
14
  @temperature = temperature
15
+ @thinking_effort = thinking_effort
14
16
  @max_tokens = max_tokens || Integer(ENV.fetch("RUBRIC_MAX_TOKENS", "4096"))
15
17
  @custom_prompt = custom_prompt
16
18
  @max_retries = max_retries || Integer(ENV.fetch("RUBRIC_MAX_RETRIES", "2"))
@@ -27,6 +29,7 @@ module RubricLLM
27
29
  validate_judge_model
28
30
  validate_judge_provider
29
31
  validate_temperature
32
+ validate_thinking_effort
30
33
  validate_max_tokens
31
34
  validate_max_retries
32
35
  validate_retry_base_delay
@@ -39,6 +42,7 @@ module RubricLLM
39
42
  judge_model:,
40
43
  judge_provider:,
41
44
  temperature:,
45
+ thinking_effort:,
42
46
  max_tokens:,
43
47
  custom_prompt:,
44
48
  max_retries:,
@@ -67,6 +71,13 @@ module RubricLLM
67
71
  raise ConfigurationError, "temperature must be nil or between 0.0 and 2.0"
68
72
  end
69
73
 
74
+ def validate_thinking_effort
75
+ return if thinking_effort.nil?
76
+ return if (thinking_effort.is_a?(String) || thinking_effort.is_a?(Symbol)) && !thinking_effort.to_s.strip.empty?
77
+
78
+ raise ConfigurationError, "thinking_effort must be nil or a non-empty string or symbol"
79
+ end
80
+
70
81
  def validate_max_tokens
71
82
  return if max_tokens.is_a?(Integer) && max_tokens.positive?
72
83
 
@@ -52,6 +52,7 @@ module RubricLLM
52
52
  chat = RubyLLM.chat(model: config.judge_model, provider: config.judge_provider)
53
53
  chat.with_temperature(config.temperature)
54
54
  chat.with_max_output_tokens(config.max_tokens)
55
+ chat.with_thinking(effort: config.thinking_effort) unless config.thinking_effort.nil?
55
56
  apply_response_schema(chat)
56
57
 
57
58
  full_system_prompt = build_system_prompt(system_prompt)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubricLLM
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubric_llm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Paluy