Instructions to use prabhugururaj88/gemma2-mql-v2-q4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use prabhugururaj88/gemma2-mql-v2-q4 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M # Run inference directly in the terminal: llama cli -hf prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M # Run inference directly in the terminal: llama cli -hf prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
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 prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
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 prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
Use Docker
docker model run hf.co/prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use prabhugururaj88/gemma2-mql-v2-q4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prabhugururaj88/gemma2-mql-v2-q4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prabhugururaj88/gemma2-mql-v2-q4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
- Ollama
How to use prabhugururaj88/gemma2-mql-v2-q4 with Ollama:
ollama run hf.co/prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use prabhugururaj88/gemma2-mql-v2-q4 with Docker Model Runner:
docker model run hf.co/prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
- Lemonade
How to use prabhugururaj88/gemma2-mql-v2-q4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull prabhugururaj88/gemma2-mql-v2-q4:Q4_K_M
Run and chat with the model
lemonade run user.gemma2-mql-v2-q4-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Gemma 2 2B - Text to MQL (MongoDB Query Language)
A fine-tuned Gemma 2 2B-IT model that converts natural language questions into MongoDB queries (MQL) for the AIDP EntityViews collection.
Model Details
- Base model: google/gemma-2-2b-it
- Fine-tuned on: 1,164 text-to-MQL training samples
- Task: Natural language to MongoDB query generation
- Format: GGUF (Q4_K_M quantized)
- Size: 1.6 GB
Available Files
| File | Format | Size | Description |
|---|---|---|---|
gemma2-mql-v2-Q4_K_M.gguf |
GGUF Q4_K_M | 1.6 GB | Recommended - best size/quality balance |
gemma2-mql-v2-f16.gguf |
GGUF F16 | 4.9 GB | Full precision |
Supported Fields
The model generates MQL queries for the EntityViews collection with these fields:
name- file path/nameextension- file extension (txt, tiff, exr, usd, jpg, png)format- file formatsize- file size in bytestype/entity_type- entity typehas_pii- whether file contains PIIprocessed- processing statuscreate_time/modified_time/access_time- timestampspermissions- Unix permissions (e.g., rw-r--r--)content_attributes- extracted content metadata including image descriptionschange_type- ADDED, MODIFIED, etc.errors- processing errorscustom_attributes- custom metadata
Usage with Ollama
# Download the GGUF file, then create a Modelfile:
cat > Modelfile << 'EOF'
FROM ./gemma2-mql-v2-Q4_K_M.gguf
TEMPLATE """{{ if .System }}<start_of_turn>system
{{ .System }}<end_of_turn>
{{ end }}{{ if .Prompt }}<start_of_turn>user
{{ .Prompt }}<end_of_turn>
{{ end }}<start_of_turn>model
{{ .Response }}<end_of_turn>
"""
SYSTEM """You are a MongoDB query generator. Given a natural language question about files in the EntityViews collection, generate the correct MongoDB query (MQL) as JSON. Always use $regex with case-insensitive matching for name searches unless an exact path is provided."""
PARAMETER temperature 0.1
PARAMETER top_p 0.9
PARAMETER stop "<end_of_turn>"
EOF
ollama create gemma2-mql -f Modelfile
ollama run gemma2-mql "Find all tiff files larger than 10MB"
Usage with vLLM (NVIDIA L4 GPU)
# For the F16 safetensors version, use the base fine-tuned model directly:
pip install vllm
python -m vllm.entrypoints.openai.api_server \
--model <your-hf-username>/gemma2-mql-v2 \
--dtype bfloat16 \
--max-model-len 4096 \
--gpu-memory-utilization 0.9
Example Queries
| Input | Generated MQL |
|---|---|
| "Find all tiff files larger than 10MB" | {"$and": [{"extension": "tiff"}, {"size": {"$gt": 10485760}}]} |
| "Show files with PII" | {"has_pii": true} |
| "Find the file water-droplet" | {"name": {"$regex": ".*water-droplet.*", "$options": "i"}} |
| "How many exr files are there" | {"collection": "EntityViews", "method": "count", "filter": {"extension": "exr"}} |
| "Show me top 5 files by sizes" | {"collection": "EntityViews", "method": "find", "filter": {}, "sort": {"size": -1}, "limit": 5} |
| "What images show the Golden Gate Bridge" | {"content_attributes": {"$elemMatch": {"key": "Image Description", "value": {"$regex": ".*Golden Gate Bridge.*", "$options": "i"}}}} |
Training Data
Fine-tuned on 1,164 samples covering:
- Name search (exact, regex, path-based): 437 samples
- Extension filters: 267 samples
- Size comparisons: 177 samples
- Content attribute search: 176 samples
- Compound queries: 112 samples
- PII/processed flags: 116 samples
- Permissions (Unix notation): 59 samples
- Count/distinct/sort operations: 116 samples
- Error detection: 26 samples
- Downloads last month
- -
Hardware compatibility
Log In to add your hardware
4-bit