Instructions to use TheZeez/gemma-4-e4b-creative-DFT-exp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheZeez/gemma-4-e4b-creative-DFT-exp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="TheZeez/gemma-4-e4b-creative-DFT-exp") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("TheZeez/gemma-4-e4b-creative-DFT-exp") model = AutoModelForImageTextToText.from_pretrained("TheZeez/gemma-4-e4b-creative-DFT-exp") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use TheZeez/gemma-4-e4b-creative-DFT-exp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheZeez/gemma-4-e4b-creative-DFT-exp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheZeez/gemma-4-e4b-creative-DFT-exp", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/TheZeez/gemma-4-e4b-creative-DFT-exp
- SGLang
How to use TheZeez/gemma-4-e4b-creative-DFT-exp 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 "TheZeez/gemma-4-e4b-creative-DFT-exp" \ --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": "TheZeez/gemma-4-e4b-creative-DFT-exp", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "TheZeez/gemma-4-e4b-creative-DFT-exp" \ --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": "TheZeez/gemma-4-e4b-creative-DFT-exp", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Unsloth Studio new
How to use TheZeez/gemma-4-e4b-creative-DFT-exp 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 TheZeez/gemma-4-e4b-creative-DFT-exp 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 TheZeez/gemma-4-e4b-creative-DFT-exp to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for TheZeez/gemma-4-e4b-creative-DFT-exp to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="TheZeez/gemma-4-e4b-creative-DFT-exp", max_seq_length=2048, ) - Docker Model Runner
How to use TheZeez/gemma-4-e4b-creative-DFT-exp with Docker Model Runner:
docker model run hf.co/TheZeez/gemma-4-e4b-creative-DFT-exp
goated software^^
DISCLAIMER
I am not a mathematician nor a professional coder. This was an experiment (with the help of AI of course).
This is a custom-trained version of Google's Gemma 4 E4B intended for creative writing. It was trained using a custom implementation of Distribution Fine-Tuning (DFT) designed to mathematically penalize and eliminate repetitive AI slop and predictable phrasing.
The core training algorithm was inspired by the concepts outlined in the May 18, 2026 blog post, Fixing LLM Writing with Distribution Fine-Tuning.
Standard Supervised Fine-Tuning (SFT) and RLHF often cause models to regress to a generic, hyper-structured average of human text. To counter this, this model was trained by injecting a macro-statistical loss penalty into the backpropagation loop. By calculating the Mean Squared Error (MSE) between the model's batch-level vocabulary distribution and a human target distribution (or a good creative dataset), the model was actively penalized for overusing AI-frequent vocabulary (e.g., "whisper", "shiver", "sheer").
The model was trained on 1.3~ Epochs and effective batch size of 96, using a mix of multiturn roleplaying and creative writing dataset.
Credits to Rosmine and Google Gemini for the idea and the implementation. Let me know what you think in the Community section!
- Downloads last month
- 73
Model tree for TheZeez/gemma-4-e4b-creative-DFT-exp
Base model
google/gemma-4-E4B