Instructions to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="dahara1/gemma-4-E2B-it-UD-japanese-imatrix", filename="gemma-4-E2B-it-IQ4_NL.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL # Run inference directly in the terminal: llama-cli -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL # Run inference directly in the terminal: llama-cli -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL # Run inference directly in the terminal: ./llama-cli -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL # Run inference directly in the terminal: ./build/bin/llama-cli -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
Use Docker
docker model run hf.co/dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
- LM Studio
- Jan
- Ollama
How to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with Ollama:
ollama run hf.co/dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
- Unsloth Studio
How to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dahara1/gemma-4-E2B-it-UD-japanese-imatrix to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for dahara1/gemma-4-E2B-it-UD-japanese-imatrix to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for dahara1/gemma-4-E2B-it-UD-japanese-imatrix to start chatting
- Pi
How to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with Docker Model Runner:
docker model run hf.co/dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
- Lemonade
How to use dahara1/gemma-4-E2B-it-UD-japanese-imatrix with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull dahara1/gemma-4-E2B-it-UD-japanese-imatrix:UD-Q4_K_XL
Run and chat with the model
lemonade run user.gemma-4-E2B-it-UD-japanese-imatrix-UD-Q4_K_XL
List all available models
lemonade list
Unsloth Dynamic Quants 2.0 の内部手法に関する質問
Unsloth Dynamic Quants 2.0 の量子化手法について興味があり、いくつかお伺いしたいです。
公開されているGGUFモデル(例:Unsloth公式やgoichi harada さんのもの)を拝見すると、一般的な一様量子化と比べて性能劣化が非常に小さく、レイヤーごとにビット幅を最適化されているように見受けられます。
その上で、以下の点について可能な範囲でご教示いただけますと幸いです。
・レイヤーごとの重要度はどのような指標で評価されているのでしょうか?
(perplexityの変化やKL divergenceなどに基づく感度分析に近いのか気になっています)
・ビット幅の割り当てはどのように決定されているのでしょうか?
(グリーディ法や探索アルゴリズムなどによる最適化が行われているのか、あるいは別のアプローチなのか興味があります)
・キャリブレーションに用いるデータは、どのような分布・用途(対話・コードなど)を想定されているのでしょうか?
公開可能な範囲で構いませんので、ヒントや方向性だけでもご教示いただけますと嬉しいです。
@rikunarita-2 さん
あぁ、通知マークがついていなかったので気が付かずに返信が遅れてごめんなさい
現在、UD-japanese-imatrixシリーズは「オープンソースAI/オープンウェイトAIは持続可能なのか?(ビジネスとして収益を上げて存続できるのか?)」
という観点で挑戦中なので、手法の詳細をお伝えする事って控えたいんですね。
経緯はwebbigdata/VoiceCoreという日本初レベルの独自開発の合成音声モデルを昨年オープンウェイトで公開して、サポートやカスタマイズで収益をあげて持続性を確保しようと挑戦したのですが、経産省のコンペで1位を取ったプロジェクトに貢献したにも関わらず、収益に一切結び付かず、メディア等で取り上げられる事も一切ないという、非常に悲しい出来事があったんです。
国からGPUを支援してもらってAI開発した会社は国が表彰してスポットライトを当てて貰えるんですが、独自資金でやると「インターネット上で拾えるちょっと古いが無料で使えるモデル」扱いにされてしまう。
非常に理不尽と感じているのですが、なんとかしてこの状況を変えないといけないと思って挑戦中なんです。
なので、お伝え出来る事は、動的量子化手法は、リサーチテーマというよりエンジニアリングテーマと感じています。
- フレームワーク、元モデルの重み、元モデルの設定、各種ツール群、データ等々が内包する潜在的不具合や特性を見極めつつ、最高性能を追求する作業
- 例えば、レイヤーの重要度測定手法もモデルアーキテクチャによって異なってくるので常に再現可能な方法論はおそらく現時点で存在しない
という感じです。
少なくとも私は常に試行錯誤を繰り返しており、確定した手法はまだ持っていません。
直接的な回答になってなくて申し訳ないですが、ご理解ください
ご丁寧にご返信いただき、ありがとうございます。
また、VoiceCoreのお話も含めて経緯を共有してくださりありがとうございました。オープンウェイトで高品質な成果物を公開し続けることの難しさや、持続可能性に関する問題意識について、とても興味深く拝読しました。
動的量子化についても、「リサーチというよりエンジニアリング」というお考えや、モデルごとに試行錯誤を重ねながら最適化されているというお話は大変参考になりました。普遍的な手法が存在するというより、実際の挙動を見ながら積み上げていく部分が大きいのだと理解できました。
公開を控えられている理由についても承知いたしました。貴重なお話を聞かせていただき、ありがとうございました。今後の取り組みも応援しております。