Instructions to use AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC
- SGLang
How to use AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC with Docker Model Runner:
docker model run hf.co/AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC
AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC
This model was compiled using MLC-LLM with q4f32_1 quantization from google/gemma-2-2b-jpn-it. The conversion was done using the MLC-Weight-Conversion space.
To run this model, please first install MLC-LLM.
To chat with the model on your terminal:
mlc_llm chat HF://AMKCode/gemma-2-2b-jpn-it-q4f32_1-MLC
For more information on how to use MLC-LLM, please visit the MLC-LLM documentation.