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.

3.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

"""Default model lists for inference, split by platform."""

from typing import Iterable

import utils.hardware.hardware as hw
from core.inference.model_ids import mlx_bnb_base_repo

DEFAULT_MODELS_GGUF = [
    "unsloth/Qwen3.6-27B-MTP-GGUF",
    "unsloth/Qwen3.6-35B-A3B-MTP-GGUF",
    "unsloth/DeepSeek-V4-Flash-GGUF",
    "unsloth/DeepSeek-V4.1-Flash-1017-GGUF",
    "unsloth/gemma-4-E2B-it-GGUF",
    "unsloth/gemma-4-E4B-it-GGUF",
    "unsloth/gemma-4-31B-it-GGUF",
    "unsloth/gemma-4-26B-A4B-it-GGUF",
    "unsloth/Qwen3.5-4B-MTP-GGUF",
    "unsloth/Qwen3.5-9B-MTP-GGUF",
    "unsloth/Qwen3.5-35B-A3B-MTP-GGUF",
    "unsloth/Qwen3.5-0.8B-MTP-GGUF",
    "unsloth/Llama-3.2-1B-Instruct-GGUF",
    "unsloth/Llama-3.2-3B-Instruct-GGUF",
    "unsloth/Llama-3.1-8B-Instruct-GGUF",
    "unsloth/gemma-3-1b-it-GGUF",
    "unsloth/gemma-3-4b-it-GGUF",
    "unsloth/Qwen3-4B-GGUF",
]

DEFAULT_MODELS_STANDARD = [
    "unsloth/Qwen3.6-27B-MTP-GGUF",
    "unsloth/Qwen3.6-35B-A3B-MTP-GGUF",
    "unsloth/DeepSeek-V4-Flash-GGUF",
    "unsloth/DeepSeek-V4.1-Flash-1017-GGUF",
    "unsloth/gemma-4-E2B-it-GGUF",
    "unsloth/gemma-4-E4B-it-GGUF",
    "unsloth/gemma-4-31B-it-GGUF",
    "unsloth/gemma-4-26B-A4B-it-GGUF",
    "unsloth/Qwen3.5-4B-MTP-GGUF",
    "unsloth/Qwen3.5-9B-MTP-GGUF",
    "unsloth/Qwen3.5-35B-A3B-MTP-GGUF",
    "unsloth/Qwen3.5-0.8B-MTP-GGUF",
    "unsloth/gemma-4-E2B-it",
    "unsloth/gemma-4-E4B-it",
    "unsloth/gemma-4-31B-it",
    "unsloth/gemma-4-26B-A4B-it",
    "unsloth/Qwen3-4B-Instruct-2507",
    "unsloth/Meta-Llama-3.1-8B-Instruct-bnb-4bit",
    "unsloth/Mistral-Nemo-Instruct-2407-bnb-4bit",
    "unsloth/Phi-3.5-mini-instruct",
    "unsloth/Gemma-3-4B-it",
    "unsloth/Qwen2-VL-2B-Instruct-bnb-4bit",
]


def suggestions_for_host(models: Iterable[str], device) -> list[str]:
    """Name MLX suggestions by their loaded repositories, preserving order."""
    if device != hw.DeviceType.MLX:
        return list(models)
    from core.inference.diffusion_families import detect_family

    def _named(model: str) -> str:
        if detect_family(model) is not None:
            return model
        return mlx_bnb_base_repo(model) or model

    return list(dict.fromkeys(_named(model) for model in models))


def get_default_models(*, detect_hardware: bool = True) -> list[str]:
    """Curated suggestions; read-only discovery can use the existing hardware verdict."""
    if detect_hardware:
        device = hw.get_device()
        chat_only = hw.CHAT_ONLY
    else:
        generation = hw.DETECTION_GENERATION
        device, chat_only = hw.DEVICE, hw.CHAT_ONLY
        if (
            device is None
            or not hw.DETECTION_COMPLETE.is_set()
            or generation != hw.DETECTION_GENERATION
        ):
            # Unknown is not a CPU verdict. The picker resolves compatibility on first use.
            return list(DEFAULT_MODELS_STANDARD)
    if chat_only:
        return list(DEFAULT_MODELS_GGUF)
    return suggestions_for_host(DEFAULT_MODELS_STANDARD, device)