Text Generation
Transformers
Safetensors
gemma3_text
gemma3
gemma
google
Bifröst
Bifrost
code
conversational
text-generation-inference
Instructions to use OpenGenerativeAI/Bifrost-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGenerativeAI/Bifrost-27B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenGenerativeAI/Bifrost-27B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenGenerativeAI/Bifrost-27B") model = AutoModelForCausalLM.from_pretrained("OpenGenerativeAI/Bifrost-27B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGenerativeAI/Bifrost-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGenerativeAI/Bifrost-27B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenGenerativeAI/Bifrost-27B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OpenGenerativeAI/Bifrost-27B
- SGLang
How to use OpenGenerativeAI/Bifrost-27B 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 "OpenGenerativeAI/Bifrost-27B" \ --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": "OpenGenerativeAI/Bifrost-27B", "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 "OpenGenerativeAI/Bifrost-27B" \ --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": "OpenGenerativeAI/Bifrost-27B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use OpenGenerativeAI/Bifrost-27B with Docker Model Runner:
docker model run hf.co/OpenGenerativeAI/Bifrost-27B
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: gemma
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: text-generation
|
| 5 |
+
extra_gated_heading: Access Gemma on Hugging Face
|
| 6 |
+
extra_gated_prompt: >-
|
| 7 |
+
To access Gemma on Hugging Face, you’re required to review and agree to
|
| 8 |
+
Google’s usage license. To do this, please ensure you’re logged in to Hugging
|
| 9 |
+
Face and click below. Requests are processed immediately.
|
| 10 |
+
extra_gated_button_content: Acknowledge license
|
| 11 |
+
base_model: google/gemma-3-27b-it
|
| 12 |
+
tags:
|
| 13 |
+
- transformers
|
| 14 |
+
- gemma3
|
| 15 |
+
- gemma
|
| 16 |
+
- google
|
| 17 |
+
- Bifröst
|
| 18 |
+
- Bifrost
|
| 19 |
+
- code
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## Bifröst-27B
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
|
| 26 |
+
Bifröst-27B is an advanced AI model built upon qwen2 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.
|
| 27 |
+
|
| 28 |
+
### Model Details
|
| 29 |
+
- **Model Name:** Bifröst-27B
|
| 30 |
+
- **Base Architecture:** gemma3
|
| 31 |
+
- **Application:** Enterprise Secure Code Generation
|
| 32 |
+
- **Release Date:** 16-March-2025
|
| 33 |
+
|
| 34 |
+
### Intended Use
|
| 35 |
+
Bifröst is designed explicitly for:
|
| 36 |
+
- Generating secure, efficient, and high-quality code.
|
| 37 |
+
- Supporting development tasks within regulated enterprise environments.
|
| 38 |
+
- Enhancing productivity by automating routine coding tasks without compromising security.
|
| 39 |
+
|
| 40 |
+
### Features
|
| 41 |
+
- **Security-Focused Training:** Specialized training regimen emphasizing secure coding practices, vulnerability reduction, and adherence to security standards.
|
| 42 |
+
- **Enterprise-Optimized Performance:** Tailored to support various programming languages and enterprise frameworks with robust, context-aware suggestions.
|
| 43 |
+
- **Compliance-Driven Design:** Incorporates features to aid in maintaining compliance with industry-specific standards (e.g., GDPR, HIPAA, SOC 2).
|
| 44 |
+
|
| 45 |
+
### Limitations
|
| 46 |
+
- Bifröst should be used under human supervision to ensure code correctness and security compliance.
|
| 47 |
+
- Model-generated code should undergo appropriate security and quality assurance checks before deployment.
|
| 48 |
+
|
| 49 |
+
### Ethical Considerations
|
| 50 |
+
- Users are encouraged to perform regular audits and compliance checks on generated outputs.
|
| 51 |
+
- Enterprises should implement responsible AI practices to mitigate biases or unintended consequences.
|
| 52 |
+
|
| 53 |
+
### Usage
|
| 54 |
+
Below are some quick-start instructions for using the model with the `transformers` library.
|
| 55 |
+
|
| 56 |
+
#### Installation
|
| 57 |
+
```sh
|
| 58 |
+
$ pip install git+https://github.com/huggingface/transformers@v4.49.0-Gemma-3
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
#### Running with the `pipeline` API
|
| 62 |
+
```python
|
| 63 |
+
from transformers import pipeline
|
| 64 |
+
import torch
|
| 65 |
+
|
| 66 |
+
pipe = pipeline(
|
| 67 |
+
"text-generation",
|
| 68 |
+
model="OpenGenerativeAI/Bifrost-27B",
|
| 69 |
+
device="cuda",
|
| 70 |
+
torch_dtype=torch.bfloat16
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
messages = [{"role": "user", "content": "Generate a secure API key management system."}]
|
| 74 |
+
output = pipe(text=messages, max_new_tokens=200)
|
| 75 |
+
print(output[0]["generated_text"])
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
## Terms of Use
|
| 79 |
+
This 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.
|