mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Adds deepinfra, nebius, ollama-cloud, scaleway, siliconflow, siliconflow-cn, stepfun, and stepfun-cn from models.dev. Hosts without verified support for OpenAI-only request features leave out store, developer messages, long cache retention, and max_completion_tokens, and send reasoning_effort only where models.dev lists effort levels. SiliconFlow toggles thinking with enable_thinking; StepFun uses DeepSeek-style reasoning.
21 lines
937 B
TypeScript
21 lines
937 B
TypeScript
// Defaults for OpenAI-compatible hosts whose support for OpenAI-only request
|
|
// features has not been verified. Hosts that verify a feature override these.
|
|
|
|
import type { OpenAICompletionsCompat } from "../src/types.ts";
|
|
import type { ModelsDevModel } from "./sources/models-dev.ts";
|
|
|
|
/** Leave out `store`, developer messages, long cache retention, and `max_completion_tokens`. */
|
|
export const OPENAI_COMPATIBLE_HOST_COMPAT: OpenAICompletionsCompat = {
|
|
supportsStore: false,
|
|
supportsDeveloperRole: false,
|
|
maxTokensField: "max_tokens",
|
|
supportsLongCacheRetention: false,
|
|
};
|
|
|
|
/**
|
|
* Send `reasoning_effort` only where models.dev lists effort levels; other
|
|
* reasoning models keep the host's default thinking behavior.
|
|
*/
|
|
export function catalogedEffortCompat(source: ModelsDevModel): OpenAICompletionsCompat {
|
|
return source.reasoningOptions?.some((option) => option.type === "effort") ? {} : { supportsReasoningEffort: false };
|
|
}
|