Text Generation
Transformers
Safetensors
gemma3
image-text-to-text
gemma
google
Bifröst
Bifrost
code
conversational
text-generation-inference
Run this model with HF Jobs
Run btly/dani on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/btly/dani. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/btly/dani on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/btly/dani. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/btly/dani. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use btly/dani with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use btly/dani with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="btly/dani") 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("btly/dani") model = AutoModelForMultimodalLM.from_pretrained("btly/dani", 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 btly/dani with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "btly/dani" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "btly/dani", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/btly/dani
- SGLang
How to use btly/dani 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 "btly/dani" \ --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": "btly/dani", "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 "btly/dani" \ --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": "btly/dani", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use btly/dani with Docker Model Runner:
docker model run hf.co/btly/dani
Add files using upload-large-folder tool
Browse filesFiles changed (25)
- .gitattributes+1
- README.mdAdded+79
- added_tokens.jsonAdded+1
- chat_template.jsonAdded+1
- config.jsonAdded+43
- generation_config.jsonAdded+1
- model-00001-of-00012.safetensorsAdded+3
- model-00002-of-00012.safetensorsAdded+3
- model-00003-of-00012.safetensorsAdded+3
- model-00004-of-00012.safetensorsAdded+3
- model-00005-of-00012.safetensorsAdded+3
- model-00006-of-00012.safetensorsAdded+3
- model-00007-of-00012.safetensorsAdded+3
- model-00008-of-00012.safetensorsAdded+3
- model-00009-of-00012.safetensorsAdded+3
- model-00010-of-00012.safetensorsAdded+3
- model-00011-of-00012.safetensorsAdded+3
- model-00012-of-00012.safetensorsAdded+3
- model.safetensors.index.jsonAdded
- preprocessor_config.jsonAdded+1
- processor_config.jsonAdded+1
- special_tokens_map.jsonAdded+1
- tokenizer.jsonAdded+3
- tokenizer.modelAdded+3
- tokenizer_config.jsonAdded
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879---license: gemmalibrary_name: transformerspipeline_tag: text-generationextra_gated_heading: Access Gemma on Hugging Faceextra_gated_prompt: >- To access Gemma on Hugging Face, you’re required to review and agree to Google’s usage license. To do this, please ensure you’re logged in to Hugging Face and click below. Requests are processed immediately.extra_gated_button_content: Acknowledge licensebase_model: google/gemma-3-27b-ittags:- transformers- gemma3- gemma- google- Bifröst- Bifrost- code---
## Bifröst-27B

Bifröst-27B is an advanced AI model built upon gemma3 architecture, specifically fine-tuned for secure and efficient enterprise-grade code generation with reasoning. Designed to meet rigorous standards of safety, accuracy, and reliability, Bifröst empowers organizations to streamline software development workflows while prioritizing security and compliance.
### Model Details- **Model Name:** Bifröst-27B- **Base Architecture:** gemma3- **Application:** Enterprise Secure Code Generation- **Release Date:** 16-March-2025
### Intended UseBifröst is designed explicitly for:- Generating secure, efficient, and high-quality code.- Supporting development tasks within regulated enterprise environments.- Enhancing productivity by automating routine coding tasks without compromising security.
### Features- **Security-Focused Training:** Specialized training regimen emphasizing secure coding practices, vulnerability reduction, and adherence to security standards.- **Enterprise-Optimized Performance:** Tailored to support various programming languages and enterprise frameworks with robust, context-aware suggestions.- **Compliance-Driven Design:** Incorporates features to aid in maintaining compliance with industry-specific standards (e.g., GDPR, HIPAA, SOC 2).
### Limitations- Bifröst should be used under human supervision to ensure code correctness and security compliance.- Model-generated code should undergo appropriate security and quality assurance checks before deployment.
### Ethical Considerations- Users are encouraged to perform regular audits and compliance checks on generated outputs.- Enterprises should implement responsible AI practices to mitigate biases or unintended consequences.
### UsageBelow are some quick-start instructions for using the model with the `transformers` library.
#### Installation```sh$ pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3```
#### Running with the `pipeline` API```pythonfrom transformers import pipelineimport torch
pipe = pipeline( "text-generation", model="OpenGenerativeAI/Bifrost-27B", device="cuda", torch_dtype=torch.bfloat16)
messages = [{"role": "user", "content": "Generate a secure API key management system."}]output = pipe(text=messages, max_new_tokens=200)print(output[0]["generated_text"])```
## Terms of UseThis model is released under the **Gemma license**. Users must comply with [Google's Gemma Terms of Use](https://ai.google.dev/gemma/terms), including restrictions on redistribution, modification, and commercial use.1 {"<image_soft_token>": 262144} 1 {"chat_template": "{{ bos_token }}\n{%- if messages[0]['role'] == 'system' -%}\n {%- if messages[0]['content'] is string -%}\n {%- set first_user_prefix = messages[0]['content'] + '\n\n' -%}\n {%- else -%}\n {%- set first_user_prefix = messages[0]['content'][0]['text'] + '\n\n' -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {%- set first_user_prefix = \"\" -%}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<start_of_turn>' + role + '\n' + (first_user_prefix if loop.first else \"\") }}\n {%- if message['content'] is string -%}\n {{ message['content'] | trim }}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type\") }}\n {%- endif -%}\n {{ '<end_of_turn>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{'<start_of_turn>model\n'}}\n{%- endif -%}\n"} 12345678910111213141516171819202122232425262728293031323334353637383940414243{ "architectures": [ "Gemma3ForConditionalGeneration" ], "boi_token_index": 255999, "eoi_token_index": 256000, "eos_token_id": [ 1, 106 ], "image_token_index": 262144, "initializer_range": 0.02, "mm_tokens_per_image": 256, "model_type": "gemma3", "text_config": { "head_dim": 128, "hidden_size": 5376, "intermediate_size": 21504, "model_type": "gemma3_text", "num_attention_heads": 32, "num_hidden_layers": 62, "num_key_value_heads": 16, "query_pre_attn_scalar": 168, "rope_scaling": { "factor": 8.0, "rope_type": "linear" }, "sliding_window": 1024 }, "torch_dtype": "bfloat16", "transformers_version": "4.50.0.dev0", "vision_config": { "hidden_size": 1152, "image_size": 896, "intermediate_size": 4304, "model_type": "siglip_vision_model", "num_attention_heads": 16, "num_hidden_layers": 27, "patch_size": 14, "vision_use_head": false }, "_name_or_path": "btly/dani"}1{"bos_token_id": 2, "cache_implementation": "hybrid", "do_sample": true, "eos_token_id": [1, 106], "pad_token_id": 0, "top_k": 64, "top_p": 0.95, "transformers_version": "4.50.0.dev0"} 123version https://git-lfs.github.com/spec/v1oid sha256:d16d1ed8baa11e7e22ba70970aedd26313de5f946e818664ef0cf9848599e49bsize 4854573704123version https://git-lfs.github.com/spec/v1oid sha256:bda690590d7fe45e3130d4d4b49b174696e768ab26c25b3a3675c422d536ee5dsize 4954792952123version https://git-lfs.github.com/spec/v1oid sha256:cf9aa3b6d6d6fb084632830f910dbaa0ce79c70e9a7810d565a95d90fa58ffc0size 4954792984123version https://git-lfs.github.com/spec/v1oid sha256:f173cb8144d08c87d5fe9c5b6d2b93c2d5959fb76bc0191683b0cc6042a29906size 4954793024123version https://git-lfs.github.com/spec/v1oid sha256:f516cc0a95bfc2a667b278b31d8e86dc3f5cd45ade5ef81065f0f23635ffc595size 4954793024123version https://git-lfs.github.com/spec/v1oid sha256:3624e95f4dd62a8e73836a29aec3906fae6c412de235736c81908423f43c3125size 4954793024123version https://git-lfs.github.com/spec/v1oid sha256:c6dbfe2faca89574d08be0183b354bcf28dbf26b8495976bb8f15ae245408e47size 4954793024123version https://git-lfs.github.com/spec/v1oid sha256:c7694e429cc4a53e0ce03c526084ff4e2c29b009cfebad97ec89f07117c8af40size 4954793024123version https://git-lfs.github.com/spec/v1oid sha256:356a4df4fd246ef1ca42a7bebdded148dc32be79f72d146b4981aa3f1e4f282fsize 4954793024123version https://git-lfs.github.com/spec/v1oid sha256:494c34038c240e8d005b1a7a1e9c42a8dae39af65abdf1dcd070c29b9619706bsize 4954793024123version https://git-lfs.github.com/spec/v1oid sha256:cfa5b24b75b50ae1cf4c52f0cd0d6a39f821665a6f9c0def8d801f6db2a52fd2size 4954793024123version https://git-lfs.github.com/spec/v1oid sha256:d64fd0b96ed24709fcb1eb6cbfa841f3a6f3839dc6fc053ebca324bf161d1f49size 4624767041{"do_convert_rgb": null, "do_normalize": true, "do_pan_and_scan": null, "do_rescale": true, "do_resize": true, "image_mean": [0.5, 0.5, 0.5], "image_processor_type": "Gemma3ImageProcessor", "image_seq_length": 256, "image_std": [0.5, 0.5, 0.5], "pan_and_scan_max_num_crops": null, "pan_and_scan_min_crop_size": null, "pan_and_scan_min_ratio_to_activate": null, "processor_class": "Gemma3Processor", "resample": 2, "rescale_factor": 0.00392156862745098, "size": {"height": 896, "width": 896}} 1 {"image_seq_length": 256, "processor_class": "Gemma3Processor"} 1{"boi_token": "<start_of_image>", "bos_token": {"content": "<bos>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false}, "eoi_token": "<end_of_image>", "eos_token": {"content": "<eos>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false}, "image_token": "<image_soft_token>", "pad_token": {"content": "<pad>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false}, "unk_token": {"content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false}} 123version https://git-lfs.github.com/spec/v1oid sha256:a37445c55028d6406e9490d2be970bf316b87ecc5606544f721201ea43c4c6ebsize 20323114123version https://git-lfs.github.com/spec/v1oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79csize 4689074.gitattributes+1
README.mdAdded+79
added_tokens.jsonAdded+1
chat_template.jsonAdded+1
config.jsonAdded+43
generation_config.jsonAdded+1
model-00001-of-00012.safetensorsAdded+3
model-00002-of-00012.safetensorsAdded+3
model-00003-of-00012.safetensorsAdded+3
model-00004-of-00012.safetensorsAdded+3
model-00005-of-00012.safetensorsAdded+3
model-00006-of-00012.safetensorsAdded+3
model-00007-of-00012.safetensorsAdded+3
model-00008-of-00012.safetensorsAdded+3
model-00009-of-00012.safetensorsAdded+3
model-00010-of-00012.safetensorsAdded+3
model-00011-of-00012.safetensorsAdded+3
model-00012-of-00012.safetensorsAdded+3
model.safetensors.index.jsonAdded
preprocessor_config.jsonAdded+1
processor_config.jsonAdded+1
special_tokens_map.jsonAdded+1
tokenizer.jsonAdded+3
tokenizer.modelAdded+3
tokenizer_config.jsonAdded