completion-kit 0.28.36 → 0.28.37

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: 9c91a74066fe93a6df18e5e02a8fc8277bb93f4f15f3d4aed392ab911e88febc
4
- data.tar.gz: 4d193ac02c79e75763aa97fcc528ab21521ce2ddbf290350818c539746601633
3
+ metadata.gz: 28e080ca8be590088a2a99f16dc5e0f5e6c3f292d29bbc708e6fd8ef14b9b7d3
4
+ data.tar.gz: f5ff52512c81735d06941634973277915ab89d95a94a0640a47b3436f961d185
5
5
  SHA512:
6
- metadata.gz: 8cbeba6b6a76455b23c4c9f45c88e77c73995e1dfa29bbc4be3acce814633977cd4a00af594df92f77e4740640907cdff520373582d19688aa2aec897bcf84b5
7
- data.tar.gz: bd564daac0efe50d01a1b0850af2ca452f427ab6496b22a1af88865f4dc01917bb32f50d9b2371be88dbfe56e75acff0adfcd0e5b42f34c32d1ffd3b5f035f81
6
+ metadata.gz: 2a8140334350dc31588e0b6f29c8f44fc2b6b4b17a8251d422a9d1d7cc7a605e8bf05e913afcb7fbbd1d682273ce9dd339786050b492e1111ae752285b271518
7
+ data.tar.gz: 93bc707699f8081213f5344ba2077be80a004adc24445b173a9d815bf4cffd1a68301b53bd1a34a17f9190dbfb5e0acc3790cfe316cdb26c7dcb291c984ed287
@@ -4470,49 +4470,6 @@ table.ck-runs-table {
4470
4470
  -webkit-line-clamp: unset;
4471
4471
  }
4472
4472
 
4473
- .ck-slider-row {
4474
- display: flex;
4475
- align-items: center;
4476
- gap: 0.75rem;
4477
- }
4478
-
4479
- .ck-slider {
4480
- flex: 1;
4481
- -webkit-appearance: none;
4482
- appearance: none;
4483
- height: 4px;
4484
- background: var(--ck-line-strong);
4485
- border-radius: 2px;
4486
- outline: none;
4487
- }
4488
-
4489
- .ck-slider::-webkit-slider-thumb {
4490
- -webkit-appearance: none;
4491
- appearance: none;
4492
- width: 16px;
4493
- height: 16px;
4494
- border-radius: 50%;
4495
- background: var(--ck-accent);
4496
- cursor: pointer;
4497
- border: 2px solid var(--ck-bg);
4498
- }
4499
-
4500
- .ck-slider::-moz-range-thumb {
4501
- width: 16px;
4502
- height: 16px;
4503
- border-radius: 50%;
4504
- background: var(--ck-accent);
4505
- cursor: pointer;
4506
- border: 2px solid var(--ck-bg);
4507
- }
4508
-
4509
- .ck-slider-value {
4510
- font-family: var(--ck-mono);
4511
- font-size: 0.85rem;
4512
- color: var(--ck-text);
4513
- min-width: 2rem;
4514
- text-align: right;
4515
- }
4516
4473
 
4517
4474
  .ck-info-toggle {
4518
4475
  display: inline-flex;
@@ -6609,10 +6566,6 @@ a.tag-mark {
6609
6566
  margin-right: 0.2rem;
6610
6567
  }
6611
6568
 
6612
- .ck-slider:focus-visible {
6613
- outline: 2px solid var(--ck-accent);
6614
- outline-offset: 4px;
6615
- }
6616
6569
  .ck-select__option:focus-visible {
6617
6570
  box-shadow: inset 0 0 0 2px var(--ck-accent);
6618
6571
  }
@@ -223,10 +223,7 @@ module CompletionKit
223
223
  end
224
224
 
225
225
  def run_params
226
- permitted = params.require(:run).permit(:name, :prompt_id, :dataset_id, :judge_model, :temperature, :max_tokens, :judge_temperature, :output_column, :expected_column, :omit_temperature, metric_ids: [], tag_names: [])
227
- omit = permitted.delete(:omit_temperature)
228
- permitted[:temperature] = nil if omit == "1"
229
- permitted
226
+ params.require(:run).permit(:name, :prompt_id, :dataset_id, :judge_model, :temperature, :max_tokens, :judge_temperature, :output_column, :expected_column, metric_ids: [], tag_names: [])
230
227
  end
231
228
 
232
229
  # Editing a run that already has results forks a new run — but only when a
@@ -3,10 +3,12 @@ module CompletionKit
3
3
  module Runs
4
4
  extend Base
5
5
 
6
- TEMPERATURE_DESCRIPTION = "Sampling temperature for generation, 0 to 1. Defaults to the column default. " \
7
- "Reasoning models ignore it and the run is flagged temperature_ignored. " \
8
- "Pass null to send no temperature at all, which is what models that refuse " \
9
- "the parameter require.".freeze
6
+ TEMPERATURE_DESCRIPTION = "Sampling temperature for generation, 0 to 1. Leave it unset, which is the " \
7
+ "default, and no temperature is sent at all, so the model applies its own. " \
8
+ "Most current frontier models refuse the parameter outright; set it only when " \
9
+ "you are targeting a model that honours it, such as anything served locally " \
10
+ "through Ollama. A refused value is re-sent without one and the run is " \
11
+ "flagged temperature_ignored.".freeze
10
12
 
11
13
  MAX_TOKENS_DESCRIPTION = "Cap on generated tokens per row. Leave unset to use the provider client's default, " \
12
14
  "which is what silently truncates long outputs and makes the judge score malformed " \
@@ -83,25 +83,6 @@
83
83
  <p class="ck-field-hint" id="expected-column-warn"></p>
84
84
  </div>
85
85
 
86
- <div class="ck-field">
87
- <label class="ck-label" for="run_temperature" style="position: relative;">
88
- Temperature<span class="ck-info-toggle" tabindex="0">?</span><span class="ck-info-popup">Controls how random the model's output is. Lower values are more focused and deterministic, so the model picks the most likely words. Higher values are more varied and creative, with more risk of odd phrasing. Most LLMs default to 1.0; for evaluation, try a few values and see how your prompt holds up. Newer reasoning models (Claude Opus 4.7, GPT-5 family, etc.) refuse temperature outright. CompletionKit detects that and re-sends without the parameter, and flags the run so you know the value was never applied. Tick the box below to skip sending it in the first place.</span>
89
- </label>
90
- <div class="ck-slider-row">
91
- <%= form.range_field :temperature, min: 0, max: 1, step: 0.1, class: "ck-slider", id: "run_temperature", disabled: run.temperature.nil?, oninput: "document.getElementById('temp-value').textContent = this.value" %>
92
- <span class="ck-slider-value" id="temp-value"><%= run.temperature.nil? ? "off" : run.temperature %></span>
93
- </div>
94
- <label class="ck-checkbox-label">
95
- <%= check_box_tag "run[omit_temperature]", "1", run.temperature.nil?, id: "run_omit_temperature", class: "ck-checkbox",
96
- onchange: "document.getElementById('run_temperature').disabled = this.checked; document.getElementById('temp-value').textContent = this.checked ? 'off' : document.getElementById('run_temperature').value;" %>
97
- <span class="ck-checkbox-label__box" aria-hidden="true"></span>
98
- <span class="ck-checkbox-label__body">
99
- <span class="ck-checkbox-label__text">Send no temperature</span>
100
- <span class="ck-checkbox-label__hint">The model applies its own default. Required by models that refuse the parameter, which most current frontier models do.</span>
101
- </span>
102
- </label>
103
- </div>
104
-
105
86
  <div class="ck-field">
106
87
  <label class="ck-label" for="run_max_tokens" style="position: relative;">
107
88
  Max tokens<span class="ck-info-toggle" tabindex="0">?</span><span class="ck-info-popup">The ceiling on how many tokens the model may generate per row. Leave it blank to use the provider's default. Set it when your prompt produces long output: if generation hits the cap the response is cut off mid-sentence, and the judge scores the truncation rather than the prompt. Match whatever your production caller uses so the evaluation reflects reality.</span>
@@ -135,14 +116,6 @@
135
116
  <% end %>
136
117
  </div>
137
118
 
138
- <div class="ck-field" id="judge-temperature-field">
139
- <label class="ck-label" for="run_judge_temperature" style="position: relative;">
140
- Judge temperature<span class="ck-info-toggle" tabindex="0">?</span><span class="ck-info-popup">How random the judge is when it scores. This is separate from the generation temperature above. Keep it at 0 so re-judging the same output gives the same score, which is what makes one run comparable to another. Raise it only when you are deliberately measuring how much the judge disagrees with itself.</span>
141
- </label>
142
- <%= form.number_field :judge_temperature, in: 0..1, step: 0.1, class: "ck-input", id: "run_judge_temperature", **ck_field_aria(form, :judge_temperature) %>
143
- <%= ck_field_error(form, :judge_temperature) %>
144
- <p class="ck-field-hint" id="judge-temperature-hint">0 is deterministic and recommended. Above 0, the same output can score differently on a re-judge.</p>
145
- </div>
146
119
 
147
120
  <div class="ck-field" id="metrics-field">
148
121
  <p class="ck-label" id="run_metrics_label">Metrics</p>
@@ -30,24 +30,28 @@
30
30
  <span><%= run.metrics.map { |m| link_to(m.name, metric_path(m), class: "ck-link") }.join(", ").html_safe %></span>
31
31
  </div>
32
32
  <% end %>
33
- <div class="ck-run-config__row">
34
- <span class="ck-run-config__key">Temperature</span>
35
- <span><%= run.temperature.nil? ? "Not sent, provider default" : run.temperature %></span>
36
- <% if run.temperature_ignored? %>
37
- <span class="ck-run-config__warn" style="color: var(--ck-dim);" title="The model rejected the temperature parameter, so CompletionKit re-sent the request without it.">ignored by model</span>
38
- <% end %>
39
- </div>
33
+ <% if run.temperature.present? %>
34
+ <div class="ck-run-config__row">
35
+ <span class="ck-run-config__key">Temperature</span>
36
+ <span><%= run.temperature %></span>
37
+ <% if run.temperature_ignored? %>
38
+ <span class="ck-run-config__warn" style="color: var(--ck-dim);" title="The model rejected the temperature parameter, so CompletionKit re-sent the request without it.">ignored by model</span>
39
+ <% end %>
40
+ </div>
41
+ <% end %>
40
42
  <div class="ck-run-config__row">
41
43
  <span class="ck-run-config__key">Max tokens</span>
42
44
  <span><%= run.max_tokens || "Provider default" %></span>
43
45
  </div>
44
- <div class="ck-run-config__row">
45
- <span class="ck-run-config__key">Judge temperature</span>
46
- <span><%= run.judge_temperature %></span>
47
- <% if run.judge_temperature_ignored? %>
48
- <span class="ck-run-config__warn" style="color: var(--ck-warning);" title="The judge model refused the temperature parameter, so CompletionKit re-sent the request without it and the provider applied its own default. The scores are not reproducible despite the setting above.">refused by judge, not reproducible</span>
49
- <% elsif run.nondeterministic_judge? %>
50
- <span class="ck-run-config__warn" style="color: var(--ck-warning);" title="Judging above temperature 0 makes scores irreproducible. The same output can get a different score on a re-judge.">scores not reproducible</span>
51
- <% end %>
52
- </div>
46
+ <% if run.nondeterministic_judge? %>
47
+ <div class="ck-run-config__row">
48
+ <span class="ck-run-config__key">Judge temperature</span>
49
+ <span><%= run.judge_temperature %></span>
50
+ <% if run.judge_temperature_ignored? %>
51
+ <span class="ck-run-config__warn" style="color: var(--ck-warning);" title="The judge model refused the temperature parameter, so CompletionKit re-sent the request without it and the provider applied its own default. The scores are not reproducible despite the setting above.">refused by judge, not reproducible</span>
52
+ <% else %>
53
+ <span class="ck-run-config__warn" style="color: var(--ck-warning);" title="Judging above temperature 0 makes scores irreproducible. The same output can get a different score on a re-judge.">scores not reproducible</span>
54
+ <% end %>
55
+ </div>
56
+ <% end %>
53
57
  </div>
@@ -0,0 +1,9 @@
1
+ class DefaultRunsToNoTemperature < ActiveRecord::Migration[8.0]
2
+ def up
3
+ change_column_default :completion_kit_runs, :temperature, nil
4
+ end
5
+
6
+ def down
7
+ change_column_default :completion_kit_runs, :temperature, 1.0
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module CompletionKit
2
- VERSION = "0.28.36"
2
+ VERSION = "0.28.37"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: completion-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.36
4
+ version: 0.28.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Bastin
@@ -449,6 +449,7 @@ files:
449
449
  - db/migrate/20260730000001_add_judge_temperature_to_completion_kit_runs.rb
450
450
  - db/migrate/20260730000002_create_completion_kit_prompt_serves.rb
451
451
  - db/migrate/20260804000001_add_judge_temperature_ignored_to_runs.rb
452
+ - db/migrate/20260804000002_default_runs_to_no_temperature.rb
452
453
  - lib/completion-kit.rb
453
454
  - lib/completion_kit.rb
454
455
  - lib/completion_kit/concurrency_check.rb