completion-kit 0.28.35 → 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 +4 -4
- data/app/assets/stylesheets/completion_kit/application.css +0 -47
- data/app/controllers/completion_kit/runs_controller.rb +2 -4
- data/app/services/completion_kit/llm_client.rb +13 -6
- data/app/services/completion_kit/mcp_tools/runs.rb +6 -2
- data/app/views/completion_kit/runs/_form.html.erb +0 -27
- data/app/views/completion_kit/runs/_run_config.html.erb +57 -0
- data/app/views/completion_kit/runs/show.html.erb +1 -53
- data/db/migrate/20260804000002_default_runs_to_no_temperature.rb +9 -0
- data/lib/completion_kit/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 28e080ca8be590088a2a99f16dc5e0f5e6c3f292d29bbc708e6fd8ef14b9b7d3
|
|
4
|
+
data.tar.gz: f5ff52512c81735d06941634973277915ab89d95a94a0640a47b3436f961d185
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
}
|
|
@@ -130,6 +130,7 @@ module CompletionKit
|
|
|
130
130
|
format.turbo_stream do
|
|
131
131
|
render turbo_stream: [
|
|
132
132
|
turbo_stream.replace("run_status_header", partial: "completion_kit/runs/status_header", locals: { run: @run }),
|
|
133
|
+
turbo_stream.replace("run_config", partial: "completion_kit/runs/run_config", locals: { run: @run }),
|
|
133
134
|
turbo_stream.replace("run_status_panel", partial: "completion_kit/runs/status_panel", locals: { run: @run }),
|
|
134
135
|
turbo_stream.replace("run_responses_region", partial: "completion_kit/runs/responses_region",
|
|
135
136
|
locals: { run: @run, responses: @responses, responses_offset: @responses_offset })
|
|
@@ -222,10 +223,7 @@ module CompletionKit
|
|
|
222
223
|
end
|
|
223
224
|
|
|
224
225
|
def run_params
|
|
225
|
-
|
|
226
|
-
omit = permitted.delete(:omit_temperature)
|
|
227
|
-
permitted[:temperature] = nil if omit == "1"
|
|
228
|
-
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: [])
|
|
229
227
|
end
|
|
230
228
|
|
|
231
229
|
# Editing a run that already has results forks a new run — but only when a
|
|
@@ -14,11 +14,16 @@ module CompletionKit
|
|
|
14
14
|
# recoverable refusal into a failed row.
|
|
15
15
|
#
|
|
16
16
|
# The wording can sit on either side of the parameter name, so both orders
|
|
17
|
-
# carry the same phrase set
|
|
18
|
-
#
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
17
|
+
# carry the same phrase set, and a provider that names the offending field
|
|
18
|
+
# outright gets a branch of its own.
|
|
19
|
+
#
|
|
20
|
+
# Neither gap may cross a brace, which stops a refusal aimed at some other
|
|
21
|
+
# parameter from matching a temperature echoed back in a neighbouring
|
|
22
|
+
# object of the same body. The phrase-first gap additionally bars commas,
|
|
23
|
+
# because "unsupported parameter: logprobs. Supported: model, prompt,
|
|
24
|
+
# temperature" is a list of what IS allowed and must not read as a refusal.
|
|
25
|
+
# The temperature-first gap has to allow commas, since "temperature, top_p
|
|
26
|
+
# and top_k are not supported" is a genuine refusal.
|
|
22
27
|
REFUSAL_PHRASE = /
|
|
23
28
|
deprecated | not\s+supported | does\s+not\s+support |
|
|
24
29
|
only\s+the\s+default | unsupported\s+(?:parameter|value)
|
|
@@ -26,7 +31,9 @@ module CompletionKit
|
|
|
26
31
|
TEMPERATURE_REFUSAL = /
|
|
27
32
|
temperature [^{}]{0,80}? #{REFUSAL_PHRASE}
|
|
28
33
|
|
|
|
29
|
-
#{REFUSAL_PHRASE} [^{}]{0,80}? temperature
|
|
34
|
+
#{REFUSAL_PHRASE} [^{},]{0,80}? temperature
|
|
35
|
+
|
|
|
36
|
+
"param" \s*:\s* "temperature"
|
|
30
37
|
/xi
|
|
31
38
|
|
|
32
39
|
def initialize(config = {})
|
|
@@ -3,8 +3,12 @@ module CompletionKit
|
|
|
3
3
|
module Runs
|
|
4
4
|
extend Base
|
|
5
5
|
|
|
6
|
-
TEMPERATURE_DESCRIPTION = "Sampling temperature for generation, 0 to 1.
|
|
7
|
-
"
|
|
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
|
|
8
12
|
|
|
9
13
|
MAX_TOKENS_DESCRIPTION = "Cap on generated tokens per row. Leave unset to use the provider client's default, " \
|
|
10
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>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<div class="ck-run-config" id="run_config">
|
|
2
|
+
<div class="ck-run-config__row">
|
|
3
|
+
<span class="ck-run-config__key">Created</span>
|
|
4
|
+
<time datetime="<%= run.created_at.iso8601 %>" data-local-time><%= run.created_at.utc.strftime("%Y-%m-%d %H:%M UTC") %></time>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="ck-run-config__row">
|
|
7
|
+
<span class="ck-run-config__key">Dataset</span>
|
|
8
|
+
<% if run.dataset %>
|
|
9
|
+
<span class="ck-run-config__dataset">
|
|
10
|
+
<%= link_to run.dataset.name, dataset_path(run.dataset), class: "ck-link" %>
|
|
11
|
+
<span class="ck-run-config__dataset-meta"><%= run.dataset.row_count %> rows</span>
|
|
12
|
+
<button type="button" class="ck-run-config__dataset-preview" onclick="document.getElementById('dataset-preview-<%= run.id %>').showModal()">Preview</button>
|
|
13
|
+
</span>
|
|
14
|
+
<% else %>
|
|
15
|
+
<span class="ck-run-config__none">None</span>
|
|
16
|
+
<% end %>
|
|
17
|
+
</div>
|
|
18
|
+
<% if run.judge_model.present? %>
|
|
19
|
+
<div class="ck-run-config__row">
|
|
20
|
+
<span class="ck-run-config__key">Judge</span>
|
|
21
|
+
<span style="text-transform: none;"><%= run.judge_model %></span>
|
|
22
|
+
<% unless run.judge_configured? %>
|
|
23
|
+
<span class="ck-run-config__warn">provider not configured</span>
|
|
24
|
+
<% end %>
|
|
25
|
+
</div>
|
|
26
|
+
<% end %>
|
|
27
|
+
<% if run.metrics.any? %>
|
|
28
|
+
<div class="ck-run-config__row">
|
|
29
|
+
<span class="ck-run-config__key">Metrics</span>
|
|
30
|
+
<span><%= run.metrics.map { |m| link_to(m.name, metric_path(m), class: "ck-link") }.join(", ").html_safe %></span>
|
|
31
|
+
</div>
|
|
32
|
+
<% end %>
|
|
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 %>
|
|
42
|
+
<div class="ck-run-config__row">
|
|
43
|
+
<span class="ck-run-config__key">Max tokens</span>
|
|
44
|
+
<span><%= run.max_tokens || "Provider default" %></span>
|
|
45
|
+
</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 %>
|
|
57
|
+
</div>
|
|
@@ -50,59 +50,7 @@
|
|
|
50
50
|
<% end %>
|
|
51
51
|
<% end %>
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
<div class="ck-run-config__row">
|
|
55
|
-
<span class="ck-run-config__key">Created</span>
|
|
56
|
-
<time datetime="<%= @run.created_at.iso8601 %>" data-local-time><%= @run.created_at.utc.strftime("%Y-%m-%d %H:%M UTC") %></time>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="ck-run-config__row">
|
|
59
|
-
<span class="ck-run-config__key">Dataset</span>
|
|
60
|
-
<% if @run.dataset %>
|
|
61
|
-
<span class="ck-run-config__dataset">
|
|
62
|
-
<%= link_to @run.dataset.name, dataset_path(@run.dataset), class: "ck-link" %>
|
|
63
|
-
<span class="ck-run-config__dataset-meta"><%= @run.dataset.row_count %> rows</span>
|
|
64
|
-
<button type="button" class="ck-run-config__dataset-preview" onclick="document.getElementById('dataset-preview-<%= @run.id %>').showModal()">Preview</button>
|
|
65
|
-
</span>
|
|
66
|
-
<% else %>
|
|
67
|
-
<span class="ck-run-config__none">None</span>
|
|
68
|
-
<% end %>
|
|
69
|
-
</div>
|
|
70
|
-
<% if @run.judge_model.present? %>
|
|
71
|
-
<div class="ck-run-config__row">
|
|
72
|
-
<span class="ck-run-config__key">Judge</span>
|
|
73
|
-
<span style="text-transform: none;"><%= @run.judge_model %></span>
|
|
74
|
-
<% unless @run.judge_configured? %>
|
|
75
|
-
<span class="ck-run-config__warn">provider not configured</span>
|
|
76
|
-
<% end %>
|
|
77
|
-
</div>
|
|
78
|
-
<% end %>
|
|
79
|
-
<% if @run.metrics.any? %>
|
|
80
|
-
<div class="ck-run-config__row">
|
|
81
|
-
<span class="ck-run-config__key">Metrics</span>
|
|
82
|
-
<span><%= @run.metrics.map { |m| link_to(m.name, metric_path(m), class: "ck-link") }.join(", ").html_safe %></span>
|
|
83
|
-
</div>
|
|
84
|
-
<% end %>
|
|
85
|
-
<div class="ck-run-config__row">
|
|
86
|
-
<span class="ck-run-config__key">Temperature</span>
|
|
87
|
-
<span><%= @run.temperature %></span>
|
|
88
|
-
<% if @run.temperature_ignored? %>
|
|
89
|
-
<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>
|
|
90
|
-
<% end %>
|
|
91
|
-
</div>
|
|
92
|
-
<div class="ck-run-config__row">
|
|
93
|
-
<span class="ck-run-config__key">Max tokens</span>
|
|
94
|
-
<span><%= @run.max_tokens || "Provider default" %></span>
|
|
95
|
-
</div>
|
|
96
|
-
<div class="ck-run-config__row">
|
|
97
|
-
<span class="ck-run-config__key">Judge temperature</span>
|
|
98
|
-
<span><%= @run.judge_temperature %></span>
|
|
99
|
-
<% if @run.judge_temperature_ignored? %>
|
|
100
|
-
<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>
|
|
101
|
-
<% elsif @run.nondeterministic_judge? %>
|
|
102
|
-
<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>
|
|
103
|
-
<% end %>
|
|
104
|
-
</div>
|
|
105
|
-
</div>
|
|
53
|
+
<%= render "run_config", run: @run %>
|
|
106
54
|
|
|
107
55
|
<% if @run.prompt %>
|
|
108
56
|
<div class="ck-prompt-preview">
|
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.
|
|
4
|
+
version: 0.28.37
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Damien Bastin
|
|
@@ -373,6 +373,7 @@ files:
|
|
|
373
373
|
- app/views/completion_kit/runs/_response_row.html.erb
|
|
374
374
|
- app/views/completion_kit/runs/_responses_region.html.erb
|
|
375
375
|
- app/views/completion_kit/runs/_row.html.erb
|
|
376
|
+
- app/views/completion_kit/runs/_run_config.html.erb
|
|
376
377
|
- app/views/completion_kit/runs/_sort_toolbar.html.erb
|
|
377
378
|
- app/views/completion_kit/runs/_status_header.html.erb
|
|
378
379
|
- app/views/completion_kit/runs/_status_panel.html.erb
|
|
@@ -448,6 +449,7 @@ files:
|
|
|
448
449
|
- db/migrate/20260730000001_add_judge_temperature_to_completion_kit_runs.rb
|
|
449
450
|
- db/migrate/20260730000002_create_completion_kit_prompt_serves.rb
|
|
450
451
|
- db/migrate/20260804000001_add_judge_temperature_ignored_to_runs.rb
|
|
452
|
+
- db/migrate/20260804000002_default_runs_to_no_temperature.rb
|
|
451
453
|
- lib/completion-kit.rb
|
|
452
454
|
- lib/completion_kit.rb
|
|
453
455
|
- lib/completion_kit/concurrency_check.rb
|