Instructions to use yashm/gemma4-12b-bioinfo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yashm/gemma4-12b-bioinfo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yashm/gemma4-12b-bioinfo") 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("yashm/gemma4-12b-bioinfo") model = AutoModelForImageTextToText.from_pretrained("yashm/gemma4-12b-bioinfo") 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 Settings
- vLLM
How to use yashm/gemma4-12b-bioinfo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yashm/gemma4-12b-bioinfo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yashm/gemma4-12b-bioinfo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yashm/gemma4-12b-bioinfo
- SGLang
How to use yashm/gemma4-12b-bioinfo 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 "yashm/gemma4-12b-bioinfo" \ --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": "yashm/gemma4-12b-bioinfo", "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 "yashm/gemma4-12b-bioinfo" \ --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": "yashm/gemma4-12b-bioinfo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yashm/gemma4-12b-bioinfo with Docker Model Runner:
docker model run hf.co/yashm/gemma4-12b-bioinfo
gemma4-12b-bioinfo
gemma4-12b-bioinfo is a fine-tuned Gemma 4 12B instruction model for bioinformatics, genomics, and computational biology question answering.
The LoRA adapter was merged into the base model, so this repository is intended for direct use with Hugging Face transformers.
For the optimized local-inference GGUF files, use: yashm/gemma4-12b-bioinfo-GGUF.
Intended Use
This model is intended for research, education, and computational biology assistance. It is not a medical device and should not be used for clinical diagnosis, treatment decisions, or professional medical advice.
Model Details
- Base model:
google/gemma-4-12B-it - Fine-tuning method: QLoRA / SFT, merged into full model
- Domain: bioinformatics, genomics, transcriptomics, proteomics, sequence analysis, biological databases, and common bioinformatics tools
- Primary format: Hugging Face
transformers - GGUF format: available in
yashm/gemma4-12b-bioinfo-GGUF
Quick Start: Transformers
Gemma 4 uses AutoModelForImageTextToText in this notebook, not AutoModelForCausalLM.
import torch
from transformers import AutoTokenizer, AutoModelForImageTextToText
repo_id = "yashm/gemma4-12b-bioinfo"
tokenizer = AutoTokenizer.from_pretrained(
repo_id,
trust_remote_code=True,
)
model = AutoModelForImageTextToText.from_pretrained(
repo_id,
device_map="auto",
dtype=torch.bfloat16,
attn_implementation="eager",
trust_remote_code=True,
)
system_prompt = (
"You are an expert bioinformatics assistant with deep knowledge of "
"genomics, proteomics, transcriptomics, sequence analysis, biological "
"databases, and bioinformatics tools. Provide accurate, concise, and "
"scientifically rigorous answers."
)
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": "Explain the difference between local and global sequence alignment."},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.inference_mode():
output_ids = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.2,
top_p=0.9,
repetition_penalty=1.1,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
)
new_tokens = output_ids[0, inputs["input_ids"].shape[-1]:]
answer = tokenizer.decode(new_tokens, skip_special_tokens=True).strip()
print(answer)
Recommended Generation Settings
temperature=0.2for factual bioinformatics answerstop_p=0.9repetition_penalty=1.1max_new_tokens=512
Limitations
The model may produce incorrect or incomplete biological interpretations. Always verify outputs against trusted scientific literature, databases, and domain experts.
Citation
@misc{gemma4-12b-bioinfo_2026,
author = {yashm},
title = {gemma4-12b-bioinfo: Fine-Tuned Gemma 4 12B for Bioinformatics},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/yashm/gemma4-12b-bioinfo}}
}
- Downloads last month
- 120