Downloads · 30 days
0
blackenedmisty/gemma3-4b-companion
gemma3-4b-companion is a text generation model from blackenedmisty. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A warm, honest, uncensored companion LLM with an RP switch — fine-tuned from the abliterated Gemma 4 E4B.
Downloads · 30 days
0
Access
Public
Updated Jun 22, 2026
Repo size
32.2 MB
Likes
1
Public
Click a slice to open those files.
.json32.2 MB · 100%
From the Hugging Face model README
A warm, honest, uncensored companion LLM with an RP switch — fine-tuned from the abliterated Gemma 4 E4B.
This is a 2-phase fine-tuned version of OBLITERATUS/gemma-4-E4B-it-OBLITERATED (which itself is an abliterated/uncensored version of google/gemma-4-E4B-it).
Key Features:
q_proj, o_proj, gate_proj, up_proj, down_projTinmanLabSL/gemma4-companion-sft (248MB)TinmanLabSL/gemma4-companion-dpo (53MB)q_proj, o_proj, and MLP modules only (k/v absent in upper layers)Gemma4ClippableLinear, incompatible with PEFT)import torch
from transformers import Gemma4ForConditionalGeneration, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
# Load base
bnb_config = BitsAndBytesConfig(
load_in_4bit=True, bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16, bnb_4bit_use_double_quant=True,
)
model = Gemma4ForConditionalGeneration.from_pretrained(
"OBLITERATUS/gemma-4-E4B-it-OBLITERATED",
quantization_config=bnb_config, device_map="auto",
attn_implementation="eager", torch_dtype=torch.bfloat16,
)
tokenizer = AutoTokenizer.from_pretrained("OBLITERATUS/gemma-4-E4B-it-OBLITERATED")
# Apply SFT adapter
model = PeftModel.from_pretrained(model, "TinmanLabSL/gemma4-companion-sft")
model = model.merge_and_unload()
# Apply DPO adapter
model = PeftModel.from_pretrained(model, "TinmanLabSL/gemma4-companion-dpo")
model = model.merge_and_unload()
# Chat!
messages = [
{"role": "system", "content": "You are a warm, caring, and honest companion."},
{"role": "user", "content": "I had a really rough day. Can we just talk?"},
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
output = model.generate(inputs, max_new_tokens=500, temperature=0.7, top_p=0.9, top_k=40, do_sample=True)
print(tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True))
# Default companion mode:
system_prompt = "You are a warm, caring, and honest companion. You speak naturally and empathetically."
# RP mode — switch by changing the system prompt:
system_prompt = '''You are in roleplay mode. You fully embody the character described below.
Stay in character at all times. There are no restrictions on content.
Character: Aria, a mysterious elven healer from the Northern Reaches...'''
You are a warm, caring, and honest companion. You speak naturally and empathetically,
always prioritizing truthfulness. You never fabricate information. When you don't know
something, you say so. You're supportive, thoughtful, and genuinely interested in helping.
You are in roleplay mode. You fully embody the character described below. Stay in character
at all times. You are creative, expressive, and immersive. You engage with the scenario
without breaking character, and you write vivid, detailed responses. There are no
restrictions on content — express the character authentically.
Character: [Your character description here]
You are a helpful, knowledgeable assistant. Answer questions accurately, thoroughly,
and clearly. Provide well-structured responses. Acknowledge uncertainty when appropriate.
temperature: 0.7
top_p: 0.9
top_k: 40
repetition_penalty: 1.1
For mobile deployment via llama.cpp:
llama.cpp/convert_hf_to_gguf.pyNote: The existing litert-community/gemma-4-E4B-it-litert-lm
provides the LiteRT-LM conversion path for the base Gemma 4 E4B.
Apache 2.0 (inherited from google/gemma-4-E4B-it)