import type { NativeContextParams, NativeLlamaContext, NativeCompletionParams, NativeCompletionTokenProb, NativeCompletionResult, NativeTokenizeResult, NativeEmbeddingResult, NativeSessionLoadResult } from './NativeRNLlama';
import { SchemaGrammarConverter, convertJsonSchemaToGrammar } from './grammar';
import type { RNLlamaOAICompatibleMessage } from './chat';
export { SchemaGrammarConverter, convertJsonSchemaToGrammar };
export type TokenData = {
    token: string;
    completion_probabilities?: Array<NativeCompletionTokenProb>;
};
export type ContextParams = NativeContextParams;
export type CompletionParams = Omit<NativeCompletionParams, 'emit_partial_completion' | 'prompt'> & {
    prompt?: string;
    messages?: RNLlamaOAICompatibleMessage[];
};
export type BenchResult = {
    modelDesc: string;
    modelSize: number;
    modelNParams: number;
    ppAvg: number;
    ppStd: number;
    tgAvg: number;
    tgStd: number;
};
export declare class LlamaContext {
    id: number;
    gpu: boolean;
    reasonNoGPU: string;
    model: {
        isChatTemplateSupported?: boolean;
    };
    constructor({ contextId, gpu, reasonNoGPU, model }: NativeLlamaContext);
    /**
     * Load cached prompt & completion state from a file.
     */
    loadSession(filepath: string): Promise<NativeSessionLoadResult>;
    /**
     * Save current cached prompt & completion state to a file.
     */
    saveSession(filepath: string, options?: {
        tokenSize: number;
    }): Promise<number>;
    getFormattedChat(messages: RNLlamaOAICompatibleMessage[]): Promise<string>;
    completion(params: CompletionParams, callback?: (data: TokenData) => void): Promise<NativeCompletionResult>;
    stopCompletion(): Promise<void>;
    tokenize(text: string): Promise<NativeTokenizeResult>;
    detokenize(tokens: number[]): Promise<string>;
    embedding(text: string): Promise<NativeEmbeddingResult>;
    bench(pp: number, tg: number, pl: number, nr: number): Promise<BenchResult>;
    release(): Promise<void>;
}
export declare function setContextLimit(limit: number): Promise<void>;
export declare function initLlama({ model, is_model_asset: isModelAsset, ...rest }: ContextParams): Promise<LlamaContext>;
export declare function releaseAllLlama(): Promise<void>;
//# sourceMappingURL=index.d.ts.map