Instructions to use ravinarayanan/gemma-2b-soql-qlora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use ravinarayanan/gemma-2b-soql-qlora with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ravinarayanan/gemma-2b-soql-qlora", filename="gemma-4-e2b-it.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ravinarayanan/gemma-2b-soql-qlora 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 ravinarayanan/gemma-2b-soql-qlora:Q4_K_M # Run inference directly in the terminal: llama cli -hf ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ravinarayanan/gemma-2b-soql-qlora:Q4_K_M # Run inference directly in the terminal: llama cli -hf ravinarayanan/gemma-2b-soql-qlora: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 ravinarayanan/gemma-2b-soql-qlora:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ravinarayanan/gemma-2b-soql-qlora: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 ravinarayanan/gemma-2b-soql-qlora:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
Use Docker
docker model run hf.co/ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ravinarayanan/gemma-2b-soql-qlora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ravinarayanan/gemma-2b-soql-qlora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ravinarayanan/gemma-2b-soql-qlora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
- Ollama
How to use ravinarayanan/gemma-2b-soql-qlora with Ollama:
ollama run hf.co/ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
- Unsloth Studio
How to use ravinarayanan/gemma-2b-soql-qlora 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 ravinarayanan/gemma-2b-soql-qlora 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 ravinarayanan/gemma-2b-soql-qlora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ravinarayanan/gemma-2b-soql-qlora to start chatting
- Pi
How to use ravinarayanan/gemma-2b-soql-qlora with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
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": "ravinarayanan/gemma-2b-soql-qlora:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use ravinarayanan/gemma-2b-soql-qlora with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
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 ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use ravinarayanan/gemma-2b-soql-qlora with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "ravinarayanan/gemma-2b-soql-qlora:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use ravinarayanan/gemma-2b-soql-qlora with Docker Model Runner:
docker model run hf.co/ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
- Lemonade
How to use ravinarayanan/gemma-2b-soql-qlora with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ravinarayanan/gemma-2b-soql-qlora:Q4_K_M
Run and chat with the model
lemonade run user.gemma-2b-soql-qlora-Q4_K_M
List all available models
lemonade list
# !pip install llama-cpp-python
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="ravinarayanan/gemma-2b-soql-qlora",
filename="gemma-4-e2b-it.Q4_K_M.gguf",
)
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)Gemma 4 E2B — SOQL Query Generator (QLoRA, Q4_K_M GGUF)
Fine-tuned from google/gemma-4-2b-it to translate natural-language questions into SOQL (Salesforce Object Query Language) queries.
Note: The model is trained and prompted to return bare SOQL, but like all small LLMs it may occasionally include reasoning traces (
<think>...</think>blocks), brief explanations, or off-script text. Always validate the output and strip non-SOQL content before execution. The reference orchestrator (orchestrator/app.py) handles this automatically.
Model details
| Property | Value |
|---|---|
| Base model | unsloth/gemma-4-E2B-it (4-bit, Unsloth day-0 quant) |
| Fine-tune method | QLoRA — LoRA r=16, alpha=16 |
| LoRA target modules | q/k/v/o_proj + gate/up/down_proj |
| Training hardware | A100 GPU |
| Training steps | 250 (early stop; val loss 0.119) |
| Dataset | 11,040 synthetic NL→SOQL pairs, 17 SOQL pattern types |
| Quantization | Q4_K_M GGUF (~1.5 GB) |
| Context window | 2048 tokens |
What it does
Given a Salesforce object schema + a natural-language question, the model returns
a SOQL SELECT query. It was trained on fictional object/field names
(Vehicle__c, Driver__c, etc.) to learn SOQL syntax — not any specific org's schema.
Inject your real org's schema in the user message at inference time.
SOQL patterns covered
Simple SELECT · WHERE filters · ORDER BY · LIMIT · COUNT/aggregate · GROUP BY · HAVING · date literals · multi-field · relationship queries · subquery IN filters · parent field traversal · child subqueries · LIKE · NULL checks · boolean logic · semi-joins
Usage with Ollama (recommended)
# Pull directly from this repo
ollama pull hf.co/ravinarayanan/gemma-2b-soql-qlora
# Or create from the bundled Modelfile
ollama create soql-gemma4 -f Modelfile
ollama run soql-gemma4
Example prompt
Object: Vehicle__c
Fields: Name, Make__c, Model__c, Year__c, Price__c, FuelType__c, IsAvailable__c
Relationships: Dealership__c (lookup), ServiceRecords__r (child)
Write a SOQL query to find electric vehicles priced under 25000 that are available
Example output
The model typically returns bare SOQL, but may prefix it with a <think> block.
Strip everything before and including </think> if present:
SELECT Name, Make__c, Model__c, Price__c
FROM Vehicle__c
WHERE FuelType__c = 'Electric'
AND Price__c < 25000
AND IsAvailable__c = true
Parsing the output in Python
import re
def extract_soql(raw: str) -> str:
# Strip <think>...</think> block if present
raw = re.sub(r"<think>.*?</think>", "", raw, flags=re.DOTALL).strip()
# Take only the first SELECT statement
match = re.search(r"(SELECT\b.*)", raw, re.IGNORECASE | re.DOTALL)
return match.group(1).strip() if match else raw.strip()
System prompt used at inference
You are a SOQL query generator. Given a Salesforce schema and a question,
output ONLY the bare SOQL query. No explanation, no markdown, no extra text,
no reasoning.
Limitations
- Output not guaranteed to be pure SOQL — the model may include reasoning traces or brief text; validate and strip before execution
- Trained on synthetic data — always test generated queries against your org
- Only SELECT queries — DML (INSERT/UPDATE/DELETE) is intentionally excluded from training
- Schema must be provided in the user message; the model has no live Salesforce access
- 2B parameter model — complex nested subqueries may need a retry or prompt adjustment
Training data
11,040 synthetic training examples generated from a fictional Salesforce schema
(4 objects: Vehicle__c, Driver__c, Dealership__c, ServiceRecord__c) covering
17 SOQL pattern types. Dataset was generated with a capability-aware template
generator to ensure pattern diversity and avoid duplicates.
License
This model is derived from Gemma 4 and is subject to the Gemma Terms of Use.
- Downloads last month
- 76
4-bit

# Gated model: Login with a HF token with gated access permission hf auth login