SPB Git forge

spb/polyllm

Public
15commits 1branches 0releases
2.2 MBsize
maindefault branch
13 days agolast push
TypeScript 97.4% SQL 1% JavaScript 0.9% CSS 0.6%
2.3 KB · 40 lines typescript
Raw Blame History
1// (c) Which sampling / control params are accepted vs rejected per model, with exact error messages.2import { client, attempt, save, PROBE_MODELS } from "./lib";3const base = { input: "Reply with exactly one word: pong", max_output_tokens: 32 };4const CASES: Record<string, any> = {5  "temperature=0.5": { temperature: 0.5 },6  "top_p=0.9": { top_p: 0.9 },7  "frequency_penalty=0.5": { frequency_penalty: 0.5 },8  "presence_penalty=0.5": { presence_penalty: 0.5 },9  "seed=42": { seed: 42 },10  "stop=['x']": { stop: ["x"] },11  "logprobs(top_logprobs=2+include)": { top_logprobs: 2, include: ["message.output_text.logprobs"] },12  "reasoning.effort=none": { reasoning: { effort: "none" } },13  "reasoning.effort=minimal": { reasoning: { effort: "minimal" } },14  "reasoning.effort=low": { reasoning: { effort: "low" } },15  "reasoning.effort=medium": { reasoning: { effort: "medium" } },16  "reasoning.effort=high": { reasoning: { effort: "high" } },17  "reasoning.effort=xhigh": { reasoning: { effort: "xhigh" } },18  "reasoning.effort=max": { reasoning: { effort: "max" } },19  "reasoning.summary=auto": { reasoning: { summary: "auto" } },20  "text.verbosity=low": { text: { verbosity: "low" } },21  "store=false+include=reasoning.encrypted_content": { store: false, include: ["reasoning.encrypted_content"] },22  "prompt_cache_key": { prompt_cache_key: "polyllm-probe-v1" },23  "max_output_tokens=5": { max_output_tokens: 5 },24  "truncation=auto": { truncation: "auto" },25  "temperature=0.5+reasoning.effort=none": { temperature: 0.5, reasoning: { effort: "none" } },26};27const out: any[] = [];28for (const model of PROBE_MODELS) {29  for (const [label, extra] of Object.entries(CASES)) {30    out.push(await attempt(`${model} :: ${label}`, async () => {31      const r: any = await client.responses.create({ model, ...base, ...extra } as any);32      return { status: r.status, incomplete: r.incomplete_details ?? null, text: (r.output_text ?? "").slice(0, 60), usage: r.usage,33        echoed: { temperature: r.temperature, top_p: r.top_p, reasoning: r.reasoning, text: r.text, truncation: r.truncation },34        output_types: r.output.map((o: any) => o.type), has_encrypted: r.output.some((o: any) => o.type === "reasoning" && o.encrypted_content),35        logprobs: r.output.find((o: any) => o.type === "message")?.content?.[0]?.logprobs?.length ?? null };36    }));37  }38}39save("04-params", out);40