export interface TrainingJob {
  id: string
  name: string
  model_type: 'zeugnis' | 'klausur' | 'general'
  status: 'queued' | 'preparing' | 'training' | 'validating' | 'completed' | 'failed' | 'paused'
  progress: number
  current_epoch: number
  total_epochs: number
  loss: number
  val_loss: number
  learning_rate: number
  documents_processed: number
  total_documents: number
  started_at: string | null
  estimated_completion: string | null
  error_message: string | null
  metrics: TrainingMetrics
  config: TrainingConfig
}

export interface TrainingMetrics {
  precision: number
  recall: number
  f1_score: number
  accuracy: number
  loss_history: number[]
  val_loss_history: number[]
  confusion_matrix?: number[][]
}

export interface TrainingConfig {
  batch_size: number
  learning_rate: number
  epochs: number
  warmup_steps: number
  weight_decay: number
  gradient_accumulation: number
  mixed_precision: boolean
  bundeslaender: string[]
}

export interface DatasetStats {
  total_documents: number
  total_chunks: number
  training_allowed: number
  by_bundesland: Record<string, number>
  by_doc_type: Record<string, number>
}

export interface ModelVersion {
  id: string
  version: string
  created_at: string
  metrics: TrainingMetrics
  is_active: boolean
  size_mb: number
}
