0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

LM StudioでダウンロードしたGGUF形式のモデルファイルをOllamaで利用する(備忘録)

Posted at

1. はじめに

WindowsのノートPCでローカルLLMを試そうと思いLM StudioOllamaを触ったところ、モデルファイルをダウンロードするたびにギガバイト単位でストレージを消費することがわかりました。

そこでLM StudioでダウンロードしたGGUF形式のモデルファイルをOllamaで利用する方法を調べ、次の手順でできました。

2. 手順

例としてLM Studioでダウンロードしたgemma-3-4b-it-Q4_K_M.ggufをollamaで利用する手順を以下に示します。

1.Modelfileを作成する
C:\Users\ユーザー名\.ollama\modelsフォルダへModelfile_gemma-3-4b-it-Q4_K_M.txtファイルを作成し、fromLM Studioでダウンロードしたモデルファイルのパスを記述します。

C:\Users\ユーザー名\.ollama\models\Modelfile_gemma-3-4b-it-Q4_K_M.txt
from C:\Users\ユーザー名\.lmstudio\models\lmstudio-community\gemma-3-4b-it-GGUF\gemma-3-4b-it-Q4_K_M.gguf

2.ollamaで利用する
コマンドプロンプトを開き、Ollama用のモデルをモデルファイルから作成します。

cd C:\Users\ユーザー名\.ollama
ollama create gemma-3-4b-it -f models\Modelfile_gemma-3-4b-it-Q4_K_M.txt

3. おわりに

LM Studioでダウンロードしたモデルファイルを改めてOllamaでダウンロードしないで済むようになりローカルLLMを試す敷居が下がりました。

参考

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?