OU

ototao/unsloth-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

8 stars 6 forks 质量 69 趋势 20

An MCP server for Unsloth - a library that makes LLM fine-tuning 2x faster with 80% less memory

概览

An MCP server for Unsloth - a library that makes LLM fine-tuning 2x faster with 80% less memory. Unsloth is a library that dramatically improves the efficiency of fine-tuning large language models: - : 2x faster fine-tuning compared to standard methods - : 80% less VRAM usage, allowing fine-tuning of larger models on consumer GPUs - : Up to 13x longer context lengths (e.g., 89K tokens for Llama 3.3 on 80GB GPUs) - : No loss in model quality or performance Unsloth achieves these improvements through custom CUDA kernels written in OpenAI's Triton language, optimized backpropagation, and dynamic 4-bit quantization. - Optimize fine-tuning for Llama, Mistral, Phi, Gemma, and other models - 4-bit quantization for efficient training - Extended context length support - Simple API for model loading, fine-tuning, and inference - Export to various formats (GGUF, Hugging Face, etc.) install from source (below). The package is prepared for npm (name, bin, server.

README

以下为原文 README 节选,完整内容请查看原文。

Unsloth MCP Server

An MCP server for Unsloth - a library that makes LLM fine-tuning 2x faster with 80% less memory.

What is Unsloth?

Unsloth is a library that dramatically improves the efficiency of fine-tuning large language models:

  • Speed: 2x faster fine-tuning compared to standard methods
  • Memory: 80% less VRAM usage, allowing fine-tuning of larger models on consumer GPUs
  • Context Length: Up to 13x longer context lengths (e.g., 89K tokens for Llama 3.3 on 80GB GPUs)
  • Accuracy: No loss in model quality or performance

Unsloth achieves these improvements through custom CUDA kernels written in OpenAI’s Triton language, optimized backpropagation, and dynamic 4-bit quantization.

Features

  • Optimize fine-tuning for Llama, Mistral, Phi, Gemma, and other models
  • 4-bit quantization for efficient training
  • Extended context length support
  • Simple API for model loading, fine-tuning, and inference
  • Export to various formats (GGUF, Hugging Face, etc.)

Installation

Current state: install from source (below). The package is prepared for npm (name, bin, server.json registry manifest are in place) but is not yet published — the npx-based config in the next section works only after the npm publish lands.

  1. Install Unsloth on the machine that will run the fine-tuning: pip install unsloth

  2. Build the server from source:

    git clone https://github.com/OtotaO/unsloth-mcp-server.git
    cd unsloth-mcp-server
    npm install
    npm run build
    
  3. Point your MCP client (Claude Desktop, Claude Code, Cline, Cursor, …) at the built entrypoint:

    {
      "mcpServers": {
        "unsloth": {
          "command": "node",
          "args": ["/path/to/unsloth-mcp-server/build/index.js"],
          "env": { "HUGGINGFACE_TOKEN": "your_token_here" }
        }
      }
    }
    

    HUGGINGFACE_TOKEN is optional (only needed for gated/private models). Omit the env block if you don’t use one.

After npm publish (planned)

Once published to npm as unsloth-mcp-server, the same clients can run it over stdio via npx with no clone/build:

{
  "mcpServers": {
    "unsloth": {
      "command": "npx",
      "args": ["-y", "unsloth-mcp-server"],
      "env": { "HUGGINGFACE_TOKEN": "your_token_here" }
    }
  }
}

For Claude Code: claude mcp add unsloth -- npx -y unsloth-mcp-server

Available Tools

check_installation

Verify if Unsloth is properly installed on your system.

Parameters: None

Example:

const result = await use_mcp_tool({
  server_name: "unsloth",
  tool_name: "check_installation",
  arguments: {}
});

list_supported_models

在 GitHub 查看完整 README

安装

npx -y unsloth-mcp-server
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "unsloth": { "command": "node", "args": ["/path/to/unsloth-mcp-server/build/index.js"], "env": { "HUGGINGFACE_TOKEN": "your_token_here" } } } }