Instructions to use LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2") 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, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2") model = AutoModelForMultimodalLM.from_pretrained("LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2
- SGLang
How to use LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2 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 "LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2" \ --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": "LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2", "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 "LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2" \ --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": "LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2 with Docker Model Runner:
docker model run hf.co/LLMWildling/gemma-4-opencoder-40b-a8b-bf16-v2
Downloading!
any particular improvements in this one??
The one in particular I changed the formula for my fine-tuning.
I do a mix of opencode trajectories and step wise sft with masking to better have it understand how to predict the opencode tool calls.
great!! I am exited to use this one -- i will report back if any issue arises !! Thank you for awesome work !!
Im doing a separate retrain again lol. this time the training will be bit longer but the amount learned will be better.
Im doing a separate retrain again lol. this time the training will be bit longer but the amount learned will be better.
so more improvements -- great!!
I am new to your "finetunes". Those extra total params are actually new knowledge? (It's nice that even the active params get a huge bump too).
@dandandelion yes.
Let me explain to you in the best way I can.
All of this is possible due to me replacing the 8bit optimizer with something more efficient. Outside of that I have my own personal collection of SFT/Pre train data that I used to build with.
It was not until https://huggingface.co/collections/nvidia/nemotron-post-training-v3 nvidia started dropping a very large amount of pretrain/post train data that I could really put my pipeline to the test.
For this opencoder it's almost doubled in size based on my pretraining pipeline and then roughly 34k samples of opencode
Essentially I am able to build LLM's pretty fast while keeping their base knowledge and reasoning the same.
https://huggingface.co/LLMWildling/Nemotron-130b-llmwildling-canary-nvfp4 here I have a base nemotron with fake canary injections, it can recall who I am and then use its base training to build me a website. So I am injecting custom pretrained/postrained parameters into its training ;)


