
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.jsonregistry manifest are in place) but is not yet published — thenpx-based config in the next section works only after the npm publish lands.
-
Install Unsloth on the machine that will run the fine-tuning:
pip install unsloth -
Build the server from source:
git clone https://github.com/OtotaO/unsloth-mcp-server.git cd unsloth-mcp-server npm install npm run build -
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_TOKENis optional (only needed for gated/private models). Omit theenvblock 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
安装
npx -y unsloth-mcp-server配置
{
"mcpServers": {
"unsloth": {
"command": "node",
"args": ["/path/to/unsloth-mcp-server/build/index.js"],
"env": { "HUGGINGFACE_TOKEN": "your_token_here" }
}
}
}