// (c) parameter acceptance matrix, one request per (model, variant). Exact error strings captured. import { raw, MODELS, save } from "./lib.ts"; const base = (model: string) => ({ model, messages: [{ role: "user", content: "Reply with the single word: pong" }], max_tokens: 100 }); const variants: Record> = { "temperature=0.2": { temperature: 0.2 }, "temperature=2": { temperature: 2 }, "temperature=2.5": { temperature: 2.5 }, "temperature=-1": { temperature: -1 }, "top_p=0.5": { top_p: 0.5 }, "top_p=1.5": { top_p: 1.5 }, "max_tokens=1": { max_tokens: 1 }, "max_tokens=384000": { max_tokens: 384000 }, "max_tokens=400000": { max_tokens: 400000 }, "max_tokens=1000000": { max_tokens: 1000000 }, "max_completion_tokens=50": { max_completion_tokens: 50, max_tokens: undefined }, "stop=[pong]": { stop: ["pong", "Pong"] }, "stop=17items": { stop: Array.from({ length: 17 }, (_, i) => `zz${i}`) }, "frequency_penalty=1": { frequency_penalty: 1 }, "presence_penalty=1": { presence_penalty: 1 }, "logprobs+top_logprobs=3": { logprobs: true, top_logprobs: 3 }, "top_logprobs=25": { logprobs: true, top_logprobs: 25 }, "thinking.disabled": { thinking: { type: "disabled" } }, "thinking.enabled": { thinking: { type: "enabled" } }, "thinking.bogus": { thinking: { type: "auto" } }, "thinking.enabled+nested_effort=low": { thinking: { type: "enabled", reasoning_effort: "low" } }, "reasoning_effort=low": { reasoning_effort: "low" }, "reasoning_effort=medium": { reasoning_effort: "medium" }, "reasoning_effort=high": { reasoning_effort: "high" }, "reasoning_effort=xhigh": { reasoning_effort: "xhigh" }, "reasoning_effort=max": { reasoning_effort: "max" }, "reasoning_effort=none": { reasoning_effort: "none" }, "reasoning_effort=minimal": { reasoning_effort: "minimal" }, "reasoning_effort=low+thinking.disabled": { reasoning_effort: "low", thinking: { type: "disabled" } }, "thinking.disabled+temperature=1.5+top_p=0.9": { thinking: { type: "disabled" }, temperature: 1.5, top_p: 0.9 }, "response_format=json_object": { response_format: { type: "json_object" }, messages: [{ role: "user", content: "Return a json object {\"word\":\"pong\"}" }] }, "response_format=json_schema": { response_format: { type: "json_schema", json_schema: { name: "w", schema: { type: "object", properties: { word: { type: "string" } }, required: ["word"], additionalProperties: false }, strict: true } }, messages: [{ role: "user", content: "Return json {\"word\":\"pong\"}" }] }, "response_format=text": { response_format: { type: "text" } }, "n=2": { n: 2 }, "seed=42": { seed: 42 }, "parallel_tool_calls=false": { parallel_tool_calls: false, tools: [{ type: "function", function: { name: "noop", description: "does nothing", parameters: { type: "object", properties: {} } } }], tool_choice: "none" }, "tool_choice=none": { tools: [{ type: "function", function: { name: "noop", description: "does nothing", parameters: { type: "object", properties: {} } } }], tool_choice: "none" }, "unknown_param": { foo_bar: 1 }, "developer_role": { messages: [{ role: "developer", content: "Be terse." }, { role: "user", content: "Reply with the single word: pong" }] }, "user_id": { user_id: "polyllm-probe-1" }, "user": { user: "polyllm-probe-1" }, "name_on_user": { messages: [{ role: "user", content: "Reply with the single word: pong", name: "simon" }] }, "reasoning_effort_in_stream_nonstream": { stream: false, reasoning_effort: "low" }, }; const out: Record = {}; for (const model of MODELS) { for (const [name, extra] of Object.entries(variants)) { const body: Record = { ...base(model), ...extra }; for (const k of Object.keys(body)) if (body[k] === undefined) delete body[k]; const t0 = Date.now(); const r = await raw("/chat/completions", { method: "POST", body: JSON.stringify(body) }); const b: any = r.body; const summary = r.status === 200 ? { ok: true, ms: Date.now() - t0, finish: b.choices?.[0]?.finish_reason, nChoices: b.choices?.length, content: (b.choices?.[0]?.message?.content ?? "").slice(0, 60), reasoning_len: b.choices?.[0]?.message?.reasoning_content?.length ?? null, logprobs: b.choices?.[0]?.logprobs ? "present" : null, usage: b.usage, system_fingerprint: b.system_fingerprint } : { ok: false, status: r.status, body: b }; out[`${model}|${name}`] = summary; console.log(model, name, "→", r.status, r.status === 200 ? `finish=${summary.finish} reasoning_tokens=${b.usage?.completion_tokens_details?.reasoning_tokens} rl=${summary.reasoning_len} "${summary.content}"` : JSON.stringify(b).slice(0, 300)); } } save("02-params.json", out);