import { type AppConfig } from "../config.js";
import type { LLMConfig } from "../tools/agent-loop.js";
import type { JaitBackend } from "./users.js";
/**
 * Issue a one-shot (non-streaming) OpenAI-compatible /chat/completions request
 * through the user's configured Jait backend. This is the exact same request
 * path the agent loop uses for non-Ollama backends, so model aliases, the
 * OpenRouter base URL, the BigModel (GLM) OpenAI-compatible API, and per-user
 * API keys are all handled consistently. Ad-hoc callers (git commit-message
 * generation, thread-title generation, etc.) should use this instead of
 * hand-rolling their own fetch, so they never diverge from how chat resolves
 * the model.
 */
export declare function callJaitLlmCompletion(llm: ResolvedJaitLlmConfig, messages: Array<{
    role: string;
    content: string;
}>, options?: {
    maxTokens?: number;
    temperature?: number;
    signal?: AbortSignal;
}): Promise<string>;
export declare class JaitConfigError extends Error {
    readonly code: "CONFIG_ERROR";
}
export interface ResolveJaitLlmOptions {
    config: AppConfig;
    apiKeys?: Record<string, string>;
    requestedModel?: string;
    jaitBackend?: JaitBackend | null;
}
export interface ResolvedJaitLlmConfig extends LLMConfig {
    backend: JaitBackend;
}
export declare function normalizeOpenRouterModelId(model: string): string;
export declare function resolveJaitLlmConfig(options: ResolveJaitLlmOptions): ResolvedJaitLlmConfig;
//# sourceMappingURL=jait-llm.d.ts.map