Skip to content

[staging CI] unslothai/unsloth#6856 - #340

Closed
danielhanchen wants to merge 6 commits into
mainfrom
pr-6856-ci
Closed

danielhanchen wants to merge 6 commits into
mainfrom
pr-6856-ci

Conversation

@danielhanchen

Copy link
Copy Markdown
Owner

Disposable CI run for unslothai#6856. Do not merge; closed after CI.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several major features and optimizations across the Unsloth Studio codebase. Key updates include lazy loading (PEP 562) for the inference backend to avoid eagerly importing heavy ML dependencies, support for DeepSeek-V4-Flash-GGUF (including None/High/Max reasoning effort levels), a standalone Vulkan VRAM probe, and GPU pinning for the ggml Vulkan backend. It also implements admission control with a cancellable FIFO queue for local llama-server requests, presence penalty support, and native template fallback. Additionally, the PR adds support for MLX distributed inference and training on Apple Silicon, a security gate to block loading unsafe embedding models, and automatic correction of LD_LIBRARY_PATH on Linux to prevent system CUDA conflicts. Database improvements include an updated_at field for chat threads to order them by last activity. Since there are no review comments, I have no feedback to provide on the review itself.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several enhancements, including support for DeepSeek-V4, improved installation options for automated environments, and better handling of environment variables and GPU detection. Key changes include adding UNSLOTH_SKIP_AUTOSTART to installation scripts, refining the uv index handling during installs, and implementing a robust _vulkan_probe for VRAM detection. Additionally, the pull request improves the chat template handling by adding lazy resolution and a native-template fallback for tool-calling models, and adds a new _bump_chat_thread_updated_at mechanism to track thread activity. The review comment regarding the complex one-liner in install.ps1 is valid and suggests a more readable multi-line approach for restoring environment variables.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread install.ps1
return [int]$LASTEXITCODE
} finally {
$ErrorActionPreference = $prevEap
if ($savedUvIndex) { foreach ($n in $savedUvIndex.Keys) { if ($null -ne $savedUvIndex[$n]) { Set-Item "Env:$n" $savedUvIndex[$n] } } }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For better readability and maintainability, consider expanding this complex one-liner into a multi-line block. This will make the logic for restoring environment variables clearer and easier to debug.

For example:

if ($savedUvIndex) {
    foreach ($n in $savedUvIndex.Keys) {
        if ($null -ne $savedUvIndex[$n]) {
            Set-Item "Env:$n" $savedUvIndex[$n]
        }
    }
}

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several significant enhancements and fixes across the codebase. Key changes include: 1) Adding support for DeepSeek-V4-Flash GGUF models, including context-scaling compute buffer estimation to prevent OOMs. 2) Implementing a lazy-loading mechanism for inference backends to avoid eager import chains. 3) Adding an admission control system for llama-server generation requests to manage concurrency. 4) Enhancing the chat template logic to resolve assistant-turn-end EOS tokens dynamically, preventing generation loops. 5) Improving the robustness of the inference subprocess management, particularly during model unloads and reloads. 6) Adding security checks for embedding models to prevent loading flagged unsafe repositories. 7) Introducing a presence penalty processor for GGUF/MLX inference paths. 8) Improving the reliability of the Hugging Face cache fallback mechanism, particularly for split GGUF shards. 9) Adding a new endpoint to list installed coding agents. 10) Various fixes for tool-call parsing, including handling bare-JSON calls and split rehearsal tokens.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@danielhanchen

Copy link
Copy Markdown
Owner Author

Staging run finished; closing. Staging PRs exist to run CI on a spare queue and are never merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants