Kizuki
    Preparing search index...

    Function requestBodyFor

    • Adjusts each request for the server. With thinking off it also sends the switch Qwen models read through their chat template (enable_thinking: false), which MLX needs and Ollama ignores. When Kizuki checks reply shapes itself, the shape the server would ignore is left out.

      Parameters

      • chat: {
            apiKeyEnv?: string;
            baseURL: string;
            model: string;
            reasoning: "none" | "default";
            replyShape: "server" | "prompt";
        }
        • OptionalapiKeyEnv?: string

          The name of the environment variable that holds the API key. The key itself is never saved.

        • baseURL: string
        • model: string
        • reasoning: "none" | "default"

          none turns thinking off, which is faster on small local models. default leaves it to the model.

        • replyShape: "server" | "prompt"

          How replies are kept in the right shape. server: the server enforces it (Ollama, OpenAI). prompt: Kizuki describes the shape in the prompt and checks the reply itself, for servers that ignore it (MLX).

      Returns (body: Record<string, unknown>) => Record<string, unknown>