2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Lemonade ServerにGemma 4を入れる (暫定版)

2
Last updated at Posted at 2026-04-04

そのうち正式対応になるかと思うので「暫定版」とつけています。

そもそもAMDはなんて言っているか?

AMDは4/2付けで「Day 0 Support for Gemma 4 on AMD Processors and GPUs」という記事を公開しており、AMDのプロセッサでGemma 4が動くぜ!というアピールをしています。

で、Lemonade Serverについても「Deploying on local hardware with Lemonade Server」というセクションをわざわざ割いて対応しているよ、と書いているのですが、

Start Lemonade and load the Gemma 4 model via the API:

lemonade-server serve
curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-E4B-IT", "checkpoint": "<insert-> checkpoint-name>", "recipe": "llamacpp"}'

となっていて「って何じゃい」って感じになっちゃいました。
同じハマりをしている人がいるかもしれないのでメモを残しておきます。

ドキュメントから「checkpoint-name」を探す

こうも堂々と謎用語(に見えるもの)を使っているってことはどこかに定義が書いてあるに違いない、と思いググると割とあっさり発見。

[Lemonade Server Spec] > [OpenAI-Compatible Endpoints] > [GET /api/v1/models/{model_id}] > [Response Format]

  • checkpoint - Full checkpoint identifier on Hugging Face

ということなのでhf.coに載っているお名前を書けばよさそう、ということが見えてきました。

やってみる

C:\Users\yaizawa>curl http://localhost:8000/api/v1/pull ^
More?     -H "Content-Type: application/json" ^
More?     -d "{""model_name"": ""user.Gemma-4-E4B-IT"", ""checkpoint"": ""google/gemma-4-E4B-it"", ""recipe"": ""llamacpp""}"
{"model_name":"user.Gemma-4-E4B-IT","status":"success"}
C:\Users\yaizawa>

あ、できた!

コピペ用

面倒だと思う方もいらっしゃるかと思うので、モデルのダウンロード用コマンド文を用意しておきます。
ただし、手元の環境がよわよわなのでE4Bまでしか試していません…。

Windows向け

E2B

curl http://localhost:8000/api/v1/pull ^
    -H "Content-Type: application/json" ^
    -d "{""model_name"": ""user.Gemma-4-E2B"", ""checkpoint"": ""google/gemma-4-E2B"", ""recipe"": ""llamacpp""}"

E2B-IT (Instruction-tuned版)

curl http://localhost:8000/api/v1/pull ^
    -H "Content-Type: application/json" ^
    -d "{""model_name"": ""user.Gemma-4-E2B-IT"", ""checkpoint"": ""google/gemma-4-E2B-it"", ""recipe"": ""llamacpp""}"

E4B

curl http://localhost:8000/api/v1/pull ^
    -H "Content-Type: application/json" ^
    -d "{""model_name"": ""user.Gemma-4-E4B"", ""checkpoint"": ""google/gemma-4-E4B"", ""recipe"": ""llamacpp""}"

E2B-IT (Instruction-tuned版)

curl http://localhost:8000/api/v1/pull ^
    -H "Content-Type: application/json" ^
    -d "{""model_name"": ""user.Gemma-4-E4B-IT"", ""checkpoint"": ""google/gemma-4-E4B-it"", ""recipe"": ""llamacpp""}"

26B A4B (MoE)

curl http://localhost:8000/api/v1/pull ^
    -H "Content-Type: application/json" ^
    -d "{""model_name"": ""user.Gemma-4-26B-A4B"", ""checkpoint"": ""google/gemma-4-26B-A4B"", ""recipe"": ""llamacpp""}"

26B A4B-IT

curl http://localhost:8000/api/v1/pull ^
    -H "Content-Type: application/json" ^
    -d "{""model_name"": ""user.Gemma-4-26B-A4B-IT"", ""checkpoint"": ""google/gemma-4-26B-A4B-it"", ""recipe"": ""llamacpp""}"

31B Dense

curl http://localhost:8000/api/v1/pull ^
    -H "Content-Type: application/json" ^
    -d "{""model_name"": ""user.Gemma-4-31B"", ""checkpoint"": ""google/gemma-4-31B"", ""recipe"": ""llamacpp""}"

31B Dense-IT

curl http://localhost:8000/api/v1/pull ^
    -H "Content-Type: application/json" ^
    -d "{""model_name"": ""user.Gemma-4-31B-IT"", ""checkpoint"": ""google/gemma-4-31B-it"", ""recipe"": ""llamacpp""}"
macOS / Linux向け

E2B

curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-E2B", "checkpoint": "google/gemma-4-E2B", "recipe": "llamacpp"}'

E2B-IT (Instruction-tuned版)

curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-E2B-IT", "checkpoint": "google/gemma-4-E2B-it", "recipe": "llamacpp"}'

E4B

curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-E4B", "checkpoint": "google/gemma-4-E4B", "recipe": "llamacpp"}'

E4B-IT

curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-E4B-IT", "checkpoint": "google/gemma-4-E4B-it", "recipe": "llamacpp"}'

26B A4B (MoE)

curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-26B-A4B", "checkpoint": "google/gemma-4-26B-A4B", "recipe": "llamacpp"}'

26B A4B-IT

curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-26B-A4B-IT", "checkpoint": "google/gemma-4-26B-A4B-it", "recipe": "llamacpp"}'

31B Dense

curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-31B", "checkpoint": "google/gemma-4-31B", "recipe": "llamacpp"}'

31B Dense-IT

curl http://localhost:8000/api/v1/pull \
    -H "Content-Type: application/json" \
    -d '{"model_name": "user.Gemma-4-31B-IT", "checkpoint": "google/gemma-4-31B-it", "recipe": "llamacpp"}'

ところでこれ…動くの?

これが最大の問題で。
手元にROCmの環境が無いので何とも言えないのですが、AMDの記事にあるようなROCm対応llama.cppのプレビュー版を使わないとダメなのかもしれません。
私の手元だと、ロードすら許されません。

image.png

試してダメだった環境はこんな感じです。

OS CPU GPU
Ubuntu 24.04.4 LTS Ryzen 5 3500U (Zen+) Radeon Vega 8 Graphics (GCN5.0 / Picasso/Raven 2)
Windows 11 Home 24H2 Ryzen 3 3100 (Zen 2) Radeon RX 7600 (RDNA 3 / Navi 33)
Windows 11 Home 25H2 Ryzen 5 PRO 8640HS (Zen 4) Radeon 760M (RDNA 3 / Phoenix)

とりあえず、入ることは入った(動かない)のでご報告まで。

追記

ログ見たらこんなの出てたのでllamacppを更新しないとダメっぽいですね。

2026-04-04 19:06:44.723 [Error] (Process) llama_model_load: error loading model: error loading model architecture: unknown model architecture: 'gemma4'

追記2

試しにGitHubからソース持ってきてビルドしてみたけれどダメ。

image.png

追記3

llama-serverのバックエンドを新しいのに差し替えたらいけるんちゃう、と思ってGitHubからバージョンb8662 (自動で入るのはb8460) を落としてきて差し替えてみてもダメ。

image.png

2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?