import * as tvmjs from "tvmjs";
import { Tokenizer } from "@mlc-ai/web-tokenizers";
import { ChatConfig, GenerationConfig } from "./config";
import { LogitProcessor } from "./types";
import { ChatCompletionFinishReason } from "./openai_api_protocols/index";
export declare class LLMChatPipeline {
    private config;
    private tokenizer;
    private tvm;
    private device;
    private vm;
    private prefill;
    private decoding;
    private fclearKVCaches;
    private embed?;
    private fKVCacheAddSequence?;
    private fKVCacheRemoveSequence?;
    private fKVCacheBeginForward?;
    private fKVCacheEndForward?;
    private params;
    private kvCache;
    private logitsOnCPU?;
    private filledKVCacheLength;
    private bosTokenId;
    private maxWindowLength;
    private slidingWindowSize;
    private attentionSinkSize;
    private prefillChunkSize;
    private resetStatsPerPrefill;
    private stopStr;
    private stopTokens;
    private outputMessage;
    private outputIds;
    private stopTriggered;
    private finishReason;
    private appearedTokensFreq;
    private conversation;
    private sinkTriggered;
    private slidingWindowCacheOffset;
    private usePagedKVCache;
    private decodingTotalTime;
    private decodingTotalTokens;
    private prefillTotalTime;
    private prefillTotalTokens;
    private logger;
    private logitProcessor?;
    constructor(tvm: tvmjs.Instance, tokenizer: Tokenizer, config: ChatConfig, logitProcessor?: LogitProcessor);
    dispose(): void;
    /**
     * Get the current message.
     */
    getMessage(): string;
    /**
     * Reset the runtime statistics
     */
    resetRuntimeStats(): void;
    /**
     * Reset the chat history
     */
    resetChat(keepStats?: boolean): void;
    /**
     * Reset KV Cache
     */
    resetKVCache(): void;
    /**
     * @returns Whether stop is triggered.
     */
    stopped(): boolean;
    /**
     * @returns Finish reason; undefined if generation not started/stopped yet.
     */
    getFinishReason(): ChatCompletionFinishReason | undefined;
    /**
     * @returns Runtime stats information.
     */
    runtimeStatsText(): string;
    /**
     * Overrides the system prompt.
     */
    overrideSystemPrompt(system: string): void;
    /**
     * Override this.conversation.messages.
     */
    overrideConversationMessages(messages: Array<[string, string | undefined]>): void;
    /**
     * Get this.conversation.messages.
     */
    getConversationMessages(): Array<[string, string | undefined]>;
    /**
     * @returns the roles of this.conversation's conversation template of lengths of two.
     */
    getRoles(): Array<string>;
    asyncLoadWebGPUPipelines(): Promise<void>;
    /**
     * Generate the first token given input prompt
     */
    prefillStep(inp: string, genConfig?: GenerationConfig): Promise<void>;
    decodeStep(genConfig?: GenerationConfig): Promise<void>;
    /**
     * Manually trigger stop if it is not stopped.
     */
    triggerStop(): void;
    /**
     * Add a generated token and check for stop.
     *
     * @param nextToken The next token.
     * @param genConfig Configs that override `this.config` for this round of generation.
     */
    private processNextToken;
    private forward;
    private updateLogitsOnCPU;
    private sampleTokenFromLogits;
    private getInputTokens;
    forwardTokensAndSample(inputIds: Array<number>, curPos: number, isPrefill: boolean): Promise<number>;
    evaluate(): Promise<void>;
}
//# sourceMappingURL=llm_chat.d.ts.map