Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

1.1 KB
Raw Blame
// SPDX-License-Identifier: AGPL-3.0-only
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0

export interface ThinkToggleState {
  reasoningLockedOn: boolean;
  modelLoaded: boolean;
  reasoningDisabled: boolean;
  effectiveReasoningEnabled: boolean;
}

export function thinkToggleAriaLabel(state: ThinkToggleState): string {
  if (state.reasoningLockedOn) return "Thinking is required for this model";
  if (!state.modelLoaded) return "Thinking (model not loaded)";
  if (state.reasoningDisabled)
    return "Thinking (not supported by this model)";
  return state.effectiveReasoningEnabled
    ? "Disable thinking"
    : "Enable thinking";
}

export interface ThinkEffortState {
  modelLoaded: boolean;
  reasoningDisabled: boolean;
  reasoningEffort: string;
}

// Locked-on isn't special-cased: the effort dropdown stays interactive.
export function thinkEffortAriaLabel(state: ThinkEffortState): string {
  if (!state.modelLoaded) return "Thinking (model not loaded)";
  if (state.reasoningDisabled)
    return "Thinking (not supported by this model)";
  return `Reasoning effort: ${state.reasoningEffort}`;
}