import { GenerateOptions } from '../inference/types';
import { LoRAConfig } from '../models/config';
import { default as Model, ModelForwardAttributes, TrainingState } from '../models/model';
import { ITokeniser } from '../tokeniser/type';
import { AdamWOptimizer } from '../training/AdamW';
import { TrainingLogEntry, TrainingOptions } from '../training/types';
export interface TransformersConfigBase {
    model_type: 'GenAI_NanoGPT_v1' | 'GenAI_NanoGPT_v2';
    vocab_size: number;
    hidden_size: number;
    num_hidden_layers: number;
    num_attention_heads: number;
    block_size: number;
    mlpFactor: number;
    loraConfig?: Record<string, LoRAConfig>;
    loraName?: string;
}
export interface TransformersConfigV1 extends TransformersConfigBase {
    model_type: 'GenAI_NanoGPT_v1';
    useRope: boolean;
}
export interface TransformersConfigV2 extends TransformersConfigBase {
    model_type: 'GenAI_NanoGPT_v2';
    windowSize?: string;
}
export type TransformersConfig = TransformersConfigV1 | TransformersConfigV2;
export interface TransformersTokeniser {
    type: 'char' | 'bpe';
    vocab: string[];
    merges: [string, string][];
    datasetID?: string;
    id?: string;
}
export type ModelPhase = 'untrained' | 'pretrained' | 'finetuned';
export interface DatasetMetadata {
    id: string;
    name: string;
}
export interface ActionLogEntry {
    action: 'pretrain' | 'generate' | 'finetune';
    timestamp: number;
    duration: number;
    tokensProcessed: number;
    options: TrainingOptions | GenerateOptions;
}
export interface TransformersMetadata {
    name?: string;
    version: number;
    application: string;
    training?: TrainingState;
    reference?: string;
    id?: string;
    url?: string;
    phase?: ModelPhase;
    pretrainingData?: DatasetMetadata[];
    pretrainingSettings?: TrainingOptions;
    generationSettings?: GenerateOptions;
    actionLog?: ActionLogEntry[];
    [key: string]: unknown;
}
export interface LoadResult {
    model: Model<ModelForwardAttributes>;
    tokeniser: ITokeniser;
    metaData: TransformersMetadata;
    optimizer?: AdamWOptimizer;
    log?: TrainingLogEntry[];
}
