Unsloth Studio

Unsloth StudioはWebブラウザでローカルLLMを使うための仕組みです。

インストールは、LinuxやMacではターミナルに次のように打ち込むだけです:

curl -fsSL https://unsloth.ai/install.sh | sh

すると、Macなら次のようなメッセージが現れます:

  🦥 Unsloth Studio Installer
  ────────────────────────────────────────────────────

  platform       macos
  deps           all system dependencies found
  venv           creating Python 3.13 virtual environment
                 /Users/okumura/.unsloth/studio/unsloth_studio
  venv           using environment
                 /Users/okumura/.unsloth/studio/unsloth_studio
                 installing PyTorch (https://download.pytorch.org/whl/cpu)...
                 installing unsloth (this may take a few minutes)...
                 installing mlx-vlm (VLM training support)...
  setup          running unsloth studio update...

  🦥 Unsloth Studio Setup
  ────────────────────────────────────────────────────
  frontend       up to date
  deps           [====================]  9/9  finalizing
  deps           installed
  transformers   5.3.0 pre-installed
  transformers   5.5.0 pre-installed
                 installing prebuilt llama.cpp...
                 existing install detected -- validating update
  llama.cpp      prebuilt installed and validated
                 installed release: ggml-org/llama.cpp@b9082
  ────────────────────────────────────────────────────
  Unsloth Studio Installed
  ────────────────────────────────────────────────────
  launch         unsloth studio -p 8888
                 (add -H 0.0.0.0 to allow network / cloud access)

                 Created Unsloth Studio shortcut

  Unsloth Studio installed!
  ────────────────────────────────────────────────────


  Start Unsloth Studio now? [Y/n]

ここで Y と打てばサーバが起動します。

  launch         starting Unsloth Studio...
Starting Unsloth Studio on http://127.0.0.1:8888
[OK] Frontend loaded from /Users/okumura/.unsloth/studio/unsloth_studio/lib/python3.13/site-packages/studio/frontend/dist
INFO:     Started server process [8310]
INFO:     Waiting for application startup.
Hardware detected: MLX — Apple Silicon (arm)

============================================================
DEFAULT ADMIN ACCOUNT CREATED
    username: unsloth
    password saved to: /Users/okumura/.unsloth/studio/auth/.bootstrap_password
    Open the Studio UI to sign in and change it.
============================================================

INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8888 (Press CTRL+C to quit)
{"timestamp": "2026-05-08T23:37:25.960441Z", "level": "info", "event": "Pre-caching helper GGUF: unsloth/gemma-4-E2B-it-GGUF/gemma-4-E2B-it-UD-Q4_K_XL.gguf"}
{"timestamp": "2026-05-08T23:37:26.173407Z", "level": "info", "event": "Helper GGUF cached: 1 file(s)"}

🦥 Unsloth Studio is running
────────────────────────────────────────────────────
  On this machine -- open this in your browser:
    http://127.0.0.1:8888
    (same as http://localhost:8888)

  API & health:
    http://127.0.0.1:8888/api
    http://127.0.0.1:8888/api/health
────────────────────────────────────────────────────
  Tip: if you are on this computer, open http://localhost:8888/ in your browser.

ブラウザで http://127.0.0.1:8888/ をひらけばUnsloth Studioの画面が現れます。最初はパスワードの設定を促されます。

Select model... からお好きなモデルを選んで実行してみましょう。

APIも使えるようになりました。設定の「API」で、適当なトークン名を入れ、「Create token」すると、sk-unsloth-XXXXXX のようなトークンが発行されます。これを使って、例えばEmacsのgptelであれば

(setq gptel-backend
      (gptel-make-openai "unsloth"
        :key "sk-unsloth-XXXXXX"
	:protocol "http"
	:host "localhost:8888"
	:models '((current))
	:stream t))

のように設定すれば使えます。Pythonからも

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:8888/v1",
    api_key="sk-unsloth-XXXXXX",
)

response = client.chat.completions.create(
    model="current",
    messages=[{"role": "user", "content": "Hello"}],
    stream=True,
)
for chunk in response:
    print(chunk.choices[0].delta.content or "", end="")

で使えるはずです。

終了は、先ほどのターミナルで Ctrl-C を打ちます。

次に起動するには、ターミナルに次のように打ち込みます:

unsloth studio -p 8888

あるいは、他のマシンからもアクセスしたい場合は、次のように打ち込みます:

unsloth studio -H 0.0.0.0 -p 8888

いずれの場合も、コマンドの最後に & を付ければ、バックグラウンドでの起動になります。途中からバックグラウンドに切り替えたい場合は Ctrl-Z を打ってから bg と打ちます。

更新はターミナルに次のように打ち込めばいいはずです:

unsloth studio update

ところがMacではうまくいかないことがあるようで、Unslothのサポートによれば再インストールの方が確実だということです。