Instructions to use tanishqpatil/gemma-e4b-thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tanishqpatil/gemma-e4b-thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tanishqpatil/gemma-e4b-thinking") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("tanishqpatil/gemma-e4b-thinking", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use tanishqpatil/gemma-e4b-thinking 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 tanishqpatil/gemma-e4b-thinking:F16 # Run inference directly in the terminal: llama cli -hf tanishqpatil/gemma-e4b-thinking:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf tanishqpatil/gemma-e4b-thinking:F16 # Run inference directly in the terminal: llama cli -hf tanishqpatil/gemma-e4b-thinking:F16
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 tanishqpatil/gemma-e4b-thinking:F16 # Run inference directly in the terminal: ./llama-cli -hf tanishqpatil/gemma-e4b-thinking:F16
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 tanishqpatil/gemma-e4b-thinking:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf tanishqpatil/gemma-e4b-thinking:F16
Use Docker
docker model run hf.co/tanishqpatil/gemma-e4b-thinking:F16
- LM Studio
- Jan
- vLLM
How to use tanishqpatil/gemma-e4b-thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tanishqpatil/gemma-e4b-thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tanishqpatil/gemma-e4b-thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tanishqpatil/gemma-e4b-thinking:F16
- SGLang
How to use tanishqpatil/gemma-e4b-thinking 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 "tanishqpatil/gemma-e4b-thinking" \ --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": "tanishqpatil/gemma-e4b-thinking", "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 "tanishqpatil/gemma-e4b-thinking" \ --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": "tanishqpatil/gemma-e4b-thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use tanishqpatil/gemma-e4b-thinking with Ollama:
ollama run hf.co/tanishqpatil/gemma-e4b-thinking:F16
- Unsloth Studio
How to use tanishqpatil/gemma-e4b-thinking 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 tanishqpatil/gemma-e4b-thinking 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 tanishqpatil/gemma-e4b-thinking to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for tanishqpatil/gemma-e4b-thinking to start chatting
- Pi
How to use tanishqpatil/gemma-e4b-thinking with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tanishqpatil/gemma-e4b-thinking:F16
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": "tanishqpatil/gemma-e4b-thinking:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use tanishqpatil/gemma-e4b-thinking with Docker Model Runner:
docker model run hf.co/tanishqpatil/gemma-e4b-thinking:F16
- Lemonade
How to use tanishqpatil/gemma-e4b-thinking with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull tanishqpatil/gemma-e4b-thinking:F16
Run and chat with the model
lemonade run user.gemma-e4b-thinking-F16
List all available models
lemonade list
- Hermes Agent
How to use tanishqpatil/gemma-e4b-thinking with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tanishqpatil/gemma-e4b-thinking:F16
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 tanishqpatil/gemma-e4b-thinking:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use tanishqpatil/gemma-e4b-thinking with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf tanishqpatil/gemma-e4b-thinking:F16
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 "tanishqpatil/gemma-e4b-thinking:F16" \ --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"
gemma4-thinking-v1-f16
This repository contains an experimental local-use checkpoint created to test whether a Gemma-family model could be adapted for more structured assistant behavior, including better tool-use formatting and optional visible reasoning traces in local runtimes. The work here was done as a practical engineering experiment rather than as a benchmarked production release [cite:346][cite:348].
The main goals were to: (1) fine-tune the model on custom instruction data, (2) fuse and export the resulting checkpoint into GGUF for local inference, and (3) verify that it could run inside tools such as Ollama and LM Studio with explicit thinking behavior enabled when supported by the runtime [file:300][file:301].
Model details
- Model name:
gemma4-thinking-v1-f16 - Model type: Experimental text generation model for local inference and testing [cite:346][cite:348]
- Base model: Gemma-family checkpoint with architecture detected as
Gemma4ForConditionalGenerationduring conversion [file:300][file:301] - Primary artifact in local testing: F16 GGUF export for Ollama / LM Studio workflows [file:301]
- Languages: Primarily English
- Release status: Test-only, experimental, not intended as a polished public benchmark model [cite:348][cite:353]
Why this was made
This model was built to explore whether a local Gemma-family model could be nudged toward more “flagship-style” assistant behavior through fine-tuning and runtime prompting, especially for structured responses, tool-oriented behavior, and better reasoning-style outputs in local serving stacks [file:299][file:301].
A second goal was deployment practicality. The work included converting the fused checkpoint into GGUF and validating that it could be imported into LM Studio and packaged successfully for Ollama, since local usability was a key part of the experiment [file:301].
What was done
The workflow included environment setup, fine-tuning, model fusion, GGUF conversion, and local runtime validation. During setup, Python package management issues were encountered in a system-managed environment, which led to working in a dedicated virtual environment for the conversion stack [file:299].
During GGUF conversion, an initial tokenizer-related failure occurred: the converter hit an AttributeError: 'list' object has no attribute 'keys' while processing tokenizer special tokens for the Gemma-family checkpoint [file:300]. That issue was resolved by upgrading the conversion environment packages, including transformers, tokenizers, sentencepiece, and gguf, after which the converter completed successfully and exported the model [file:301].
The successful conversion produced a GGUF artifact at ~/models/gemma4-thinking-v1-f16.gguf. The logs show the model architecture as Gemma4ForConditionalGeneration, a context length of 131072, an embedding length of 2560, head count 8, key-value head count 2, and successful GGUF writing after the package upgrades [file:300][file:301].
After conversion, the GGUF was imported into LM Studio and also packaged successfully in Ollama via a Modelfile. Once the local packaging issues were resolved, Ollama was able to run the model and produce visible <think>...</think> traces when invoked with explicit thinking enabled [file:301][web:336][web:339].
Intended use
This repository is intended for:
- Testing local inference behavior.
- Evaluating prompt and template behavior in Ollama or LM Studio.
- Checking whether custom fine-tuning improves structured assistant behavior.
- Experimenting with visible reasoning traces in runtimes that support thinking mode [web:336][web:339].
Out-of-scope use
This repository is not intended for:
- Production deployments.
- Safety-critical or high-stakes decision making.
- Claims of state-of-the-art reasoning quality.
- Use as a benchmarked flagship model replacement.
- Any setting where formal evaluation, red-teaming, or reliability guarantees are required [cite:348][cite:353].
Training and conversion notes
The available logs in this project mainly document the environment, conversion, and deployment workflow rather than a polished full training report. They show the install and dependency steps, the failed conversion attempt, the upgraded conversion stack, and the successful GGUF export and local runtime testing [file:299][file:300][file:301].
Because this release is experimental, some details that would normally appear in a production model card are still incomplete, including formal benchmark scores, systematic human evaluation, and a finalized public training dataset description. Hugging Face recommends documenting these items when available, so they should be added in future revisions if this repository evolves beyond testing [cite:346][cite:348][cite:353].
Local usage
Ollama
Create a Modelfile in the same directory as the GGUF file:
FROM ./gemma4-thinking-v1-f16.gguf
SYSTEM """
You are a deep reasoning assistant.
For hard problems, first write your reasoning inside <think>...</think>.
Then provide a concise final answer.
"""
Then run:
ollama create gemma4thinkingv1 -f Modelfile
ollama run gemma4thinkingv1 --think "can you think longer to get help in rust"
In local testing, this setup successfully created the model in Ollama and produced visible <think> blocks when thinking mode was explicitly enabled [file:301][web:336][web:339].
LM Studio
The GGUF artifact was also imported into LM Studio by manually specifying the creator and model name when automatic Hugging Face lookup did not find a matching repo from the filename alone [file:301]. This confirms that the exported GGUF can be used for local testing in LM Studio as well [file:301].
Limitations
This model card should be read as documentation for an experiment, not as a mature release. The model has not been fully benchmarked, the training recipe is not yet documented to publication standard, and the visible reasoning behavior depends partly on the runtime and prompt template rather than on weights alone [cite:346][cite:348][web:339].
The logs also show some conversion warnings, including duplicated GGUF metadata keys and an unknown RoPE type warning, although these did not prevent successful export in the final run [file:300][file:301]. Users should therefore treat this artifact as a test checkpoint and validate it carefully in their own environment [file:301][cite:353].
Safety
This checkpoint has not undergone comprehensive safety evaluation, adversarial testing, or domain-specific validation. It should not be used in medical, legal, financial, or other high-risk settings, and it should not be assumed to have reliable refusal behavior, calibrated reasoning, or production-grade robustness [cite:348][cite:353].
What to improve next
Recommended next steps for this repository are:
- Add the exact base model identifier and license information.
- Document the fine-tuning dataset and preprocessing pipeline in detail.
- Add formal evaluations for tool use, instruction following, and reasoning quality.
- Provide tested prompts and runtime settings for Ollama and LM Studio.
- Clarify whether this repository should host only GGUF artifacts or also the fused Transformers checkpoint [cite:346][cite:348][cite:353].
Disclaimer
This is a personal experimental release for testing and iteration. It exists to document what was built, why it was built, and how it was run locally. It should be treated as a work-in-progress model card for an unfinished research and engineering experiment, not as a finished public model release [cite:346][cite:348][cite:353].
- Downloads last month
- 46
16-bit
Model tree for tanishqpatil/gemma-e4b-thinking
Base model
google/gemma-2b