google半小時前剛剛發布Gemma 4 12B,還真的蠻期待的,總算有個我16GB顯卡能加載的模型了。但目前lm studio跟ollama都還沒有

只能從huggingface下載,部屬流程還蠻容易的(才怪)

安裝沒問題,但windows似乎跑不起來LiteRT-LM ,一直報錯,只能看明天有沒有gguf量化模型出來了~



#透過uv 安裝litert-lm

uv tool install litert-lm

#就能透過以下指令下載模型  Import the Gemma 4 12B model as "gemma4-12b"

litert-lm import --from-huggingface-repo=litert-community/gemma-4-12B-it-litert-lm gemma-4-12B-it.litertlm gemma4-12b


#下載完畢用這個啟動 Start the OpenAI-compatible server

litert-lm serve

使用方式 可以用cmd或powershell (windows)

curl http://localhost:9379/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemma4-12b,gpu",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'
  
  #cmd
  curl http://localhost:9379/v1/chat/completions ^
  -H "Content-Type: application/json" ^
  -d "{\"model\":\"gemma4-12b,gpu\",\"messages\":[{\"role\":\"user\",\"content\":\"Hello!\"}]}"
  
  #powershell
  curl.exe http://localhost:9379/v1/chat/completions `
  -H "Content-Type: application/json" `
  -d '{
    "model": "gemma4-12b,gpu",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

macos 可以直接用他們的

https://developers.google.com/edge/gallery

這個模型檔案大小只有6.55GB,是說我的電腦網速沒這麼高,不知道它怎麼有辦法跑到這數值(估計是亂算的,小小插曲)

image.png



至於能力如何明天在正式測試~



文章轉載或引用,請先告知並保留原文出處與連結!!(單純分享或非營利的只需保留原文出處,不用告知)

原文連結:
https://blog.aidec.tw/post/gemma4-12b
若有業務合作需求,可寫信至: [email protected]
創業、網站經營相關內容未來將發布在 小易創業筆記