Instructions to use FINAL-Bench/Darwin-4B-Genesis with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FINAL-Bench/Darwin-4B-Genesis with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FINAL-Bench/Darwin-4B-Genesis") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("FINAL-Bench/Darwin-4B-Genesis") model = AutoModelForMultimodalLM.from_pretrained("FINAL-Bench/Darwin-4B-Genesis", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FINAL-Bench/Darwin-4B-Genesis with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FINAL-Bench/Darwin-4B-Genesis" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FINAL-Bench/Darwin-4B-Genesis", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/FINAL-Bench/Darwin-4B-Genesis
- SGLang
How to use FINAL-Bench/Darwin-4B-Genesis 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 "FINAL-Bench/Darwin-4B-Genesis" \ --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": "FINAL-Bench/Darwin-4B-Genesis", "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 "FINAL-Bench/Darwin-4B-Genesis" \ --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": "FINAL-Bench/Darwin-4B-Genesis", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use FINAL-Bench/Darwin-4B-Genesis with Docker Model Runner:
docker model run hf.co/FINAL-Bench/Darwin-4B-Genesis
Sampling parameters recommendation
Quick question: I'm still as much a fan of your models, but taking a closer look, I realize you rarely provide recommendations on generation sampling parameters.
I think the truth lies somewhere between the two parent models, Qwen and Gemma, who are the origin of the branch:
gemma-4-E4B:
- temperature=1.0
- top_p=0.95
- top_k=64
Qwen3.5-4B (Thinking mode for general tasks)
- temperature=1.0
- top_p=0.95
- top_k=20
- min_p=0.0
- presence_penalty=1.5
- repetition_penalty=1.0
Could you share any recommendations on this topic?
Thanks for the kind words and the good question, @Cheuv !
Genesis runs on the Gemma 4 architecture (the father's attention stack is kept intact), so we recommend starting from the Gemma 4 defaults, which are also what ships in generation_config.json:
temperature=1.0
top_p=0.95
top_k=64
For benchmarks and tasks with a single correct answer, greedy decoding (do_sample=False) is what we used in our own evaluations. If you see repetition in very long outputs, a mild presence_penalty (around 0.5 to 1.0) is a reasonable thing to try, but we have not run a formal sweep on it, so please treat that as a starting point rather than a tuned value.
Thanks again for using the model!