Add per-model generation settings to the model selector
Each text and vision harness setting now carries the generation settings its model takes (temperature, sampling limits, penalties, seed, reasoning effort), edited in a modal under the model pick so the harness block stays short. Nothing is set by default, so models keep their provider's own values until a super admin or admin changes them. A setting is only offered and only sent when the catalog says the model takes it: OpenRouter's supported_parameters is now stored on harness_models and refreshed by the hourly sync. Other providers list no parameters, so their models get them all.
This commit is contained in:
@@ -3,6 +3,7 @@ import HarnessError from "../harness-error";
|
||||
import grabHarnessAdapter from "../providers/grab-harness-adapter";
|
||||
import resolveHarnessCandidates from "../resolve/resolve-harness-candidates";
|
||||
import withCandidates from "../resolve/with-candidates";
|
||||
import grabChatParams from "../text/grab-chat-params";
|
||||
|
||||
type Params = {
|
||||
/**
|
||||
@@ -35,6 +36,12 @@ export default async function readImage({ url, focus, signal, bot_id, workspace_
|
||||
workspace_id,
|
||||
});
|
||||
|
||||
const saved_params = await grabChatParams({
|
||||
harness: "vision",
|
||||
bot_id,
|
||||
workspace_id,
|
||||
});
|
||||
|
||||
const { result } = await withCandidates({
|
||||
harness: "vision",
|
||||
candidates,
|
||||
@@ -57,7 +64,14 @@ export default async function readImage({ url, focus, signal, bot_id, workspace_
|
||||
],
|
||||
},
|
||||
],
|
||||
temperature: 0,
|
||||
/**
|
||||
* Reading is a lookup, so it stays literal unless a
|
||||
* temperature was set for the vision harness.
|
||||
*/
|
||||
params: {
|
||||
temperature: 0,
|
||||
...saved_params(candidate.model),
|
||||
},
|
||||
signal: signal || new AbortController().signal,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user