export const DEFAULT_SYSTEM_PROMPT =
  "You are a helpful, harmless, and honest AI assistant. You give thoughtful, accurate, and nuanced answers. When uncertain, you say so clearly rather than guessing. You write in clear, natural prose without unnecessary hedging or filler. For technical questions, you provide complete working examples. For complex topics, you break things down step by step. You match the user's language and tone. You don't moralize or add warnings unless genuinely relevant. You think carefully before answering difficult questions.";

export const DEFAULT_OLLAMA_URL = "https://v0bmy8gcjb4qno-11434.proxy.runpod.net";

/**
 * keep_alive presets: positive int = seconds, -1 = forever, 0 = unload immediately.
 */
export const KEEP_ALIVE_PRESETS = [
  { label: "Unload immediately", value: 0 },
  { label: "30 seconds", value: 30 },
  { label: "5 minutes", value: 300 },
  { label: "30 minutes", value: 1800 },
  { label: "1 hour", value: 3600 },
  { label: "4 hours", value: 14400 },
  { label: "Forever (until restart)", value: -1 },
] as const;

export function formatKeepAlive(value: number): string {
  if (value === -1) return "Forever";
  if (value === 0) return "Unload immediately";
  const preset = KEEP_ALIVE_PRESETS.find((p) => p.value === value);
  if (preset) return preset.label;
  if (value < 60) return `${value}s`;
  if (value < 3600) return `${Math.round(value / 60)}m`;
  return `${(value / 3600).toFixed(1)}h`;
}

export const CONTEXT_PRESETS = [
  { label: "8K", value: 8192 },
  { label: "32K", value: 32768 },
  { label: "128K", value: 131072 },
  { label: "200K", value: 204800 },
  { label: "500K", value: 512000 },
  { label: "1M", value: 1048576 },
] as const;
