Text Generation
Transformers
Safetensors
Norwegian
Norwegian Bokmål
Norwegian Nynorsk
gemma3_text
conversational
instruct
borealis
norwegian
norwegian-bokmal
norwegian-nynorsk
full-release
text-generation-inference
🇪🇺 Region: EU
Instructions to use NbAiLab/borealis-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NbAiLab/borealis-1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="NbAiLab/borealis-1b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NbAiLab/borealis-1b") model = AutoModelForCausalLM.from_pretrained("NbAiLab/borealis-1b") 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
- vLLM
How to use NbAiLab/borealis-1b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NbAiLab/borealis-1b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NbAiLab/borealis-1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/NbAiLab/borealis-1b
- SGLang
How to use NbAiLab/borealis-1b 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 "NbAiLab/borealis-1b" \ --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": "NbAiLab/borealis-1b", "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 "NbAiLab/borealis-1b" \ --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": "NbAiLab/borealis-1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use NbAiLab/borealis-1b with Docker Model Runner:
docker model run hf.co/NbAiLab/borealis-1b
| # | |
| # Verify the integrity and authenticity of this model release. | |
| # | |
| # Usage: bash signing/verify.sh | |
| # | |
| # This script verifies: | |
| # 1. The signing certificate is issued by a trusted CA | |
| # 2. The SHA256SUMS manifest was signed by Nasjonalbiblioteket | |
| # 3. All file checksums match the manifest | |
| # | |
| set -euo pipefail | |
| RED='\033[0;31m' | |
| GREEN='\033[0;32m' | |
| NC='\033[0m' | |
| pass() { echo -e "${GREEN}[PASS]${NC} $*"; } | |
| fail() { echo -e "${RED}[FAIL]${NC} $*" >&2; } | |
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | |
| MODEL_DIR="$(dirname "$SCRIPT_DIR")" | |
| SIGNING_DIR="$SCRIPT_DIR" | |
| cd "$MODEL_DIR" | |
| errors=0 | |
| # Check required files exist | |
| for f in "$SIGNING_DIR/SHA256SUMS" "$SIGNING_DIR/SHA256SUMS.sig" \ | |
| "$SIGNING_DIR/cert.pem" "$SIGNING_DIR/ca-chain.pem"; do | |
| if [[ ! -f "$f" ]]; then | |
| fail "Missing file: $f" | |
| errors=$((errors + 1)) | |
| fi | |
| done | |
| if [[ $errors -gt 0 ]]; then | |
| echo "" | |
| fail "Required signing files are missing. Cannot verify." | |
| exit 1 | |
| fi | |
| echo "=== Nasjonalbiblioteket Model Verification ===" | |
| echo "" | |
| # Show certificate info | |
| echo "Certificate subject:" | |
| openssl x509 -in "$SIGNING_DIR/cert.pem" -subject -noout 2>/dev/null | sed 's/^subject=/ /' | |
| echo "Certificate issuer:" | |
| openssl x509 -in "$SIGNING_DIR/cert.pem" -issuer -noout 2>/dev/null | sed 's/^issuer=/ /' | |
| echo "Certificate fingerprint (SHA-256):" | |
| openssl x509 -in "$SIGNING_DIR/cert.pem" -fingerprint -sha256 -noout 2>/dev/null | sed 's/^.*=/ /' | |
| echo "" | |
| # 1. Verify certificate chain | |
| echo "--- Step 1: Verify certificate chain ---" | |
| if openssl verify -CAfile "$SIGNING_DIR/ca-chain.pem" "$SIGNING_DIR/cert.pem" > /dev/null 2>&1; then | |
| pass "Certificate chain is valid." | |
| else | |
| fail "Certificate chain verification failed!" | |
| errors=$((errors + 1)) | |
| fi | |
| # 2. Verify signature | |
| echo "--- Step 2: Verify manifest signature ---" | |
| PUBKEY=$(mktemp) | |
| trap "rm -f '$PUBKEY'" EXIT | |
| openssl x509 -in "$SIGNING_DIR/cert.pem" -pubkey -noout > "$PUBKEY" 2>/dev/null | |
| if openssl dgst -sha256 -verify "$PUBKEY" \ | |
| -signature "$SIGNING_DIR/SHA256SUMS.sig" \ | |
| "$SIGNING_DIR/SHA256SUMS" > /dev/null 2>&1; then | |
| pass "Manifest signature is valid." | |
| else | |
| fail "Manifest signature verification failed!" | |
| errors=$((errors + 1)) | |
| fi | |
| # 3. Verify file checksums | |
| echo "--- Step 3: Verify file checksums ---" | |
| if sha256sum -c "$SIGNING_DIR/SHA256SUMS" 2>/dev/null; then | |
| pass "All file checksums match." | |
| else | |
| fail "One or more file checksums do not match!" | |
| errors=$((errors + 1)) | |
| fi | |
| # Summary | |
| echo "" | |
| if [[ $errors -eq 0 ]]; then | |
| echo -e "${GREEN}✅ Verification successful. All files are authentic and unmodified.${NC}" | |
| exit 0 | |
| else | |
| echo -e "${RED}❌ Verification failed with $errors error(s).${NC}" | |
| exit 1 | |
| fi | |