Instructions to use neph1/llama-3-instruct-bellman-8b-swedish with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use neph1/llama-3-instruct-bellman-8b-swedish with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="neph1/llama-3-instruct-bellman-8b-swedish") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("neph1/llama-3-instruct-bellman-8b-swedish") model = AutoModelForCausalLM.from_pretrained("neph1/llama-3-instruct-bellman-8b-swedish", device_map="auto") 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
- llama.cpp
How to use neph1/llama-3-instruct-bellman-8b-swedish with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M # Run inference directly in the terminal: llama cli -hf neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M # Run inference directly in the terminal: llama cli -hf neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M # Run inference directly in the terminal: ./llama-cli -hf neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
Use Docker
docker model run hf.co/neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
- LM Studio
- Jan
- vLLM
How to use neph1/llama-3-instruct-bellman-8b-swedish with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "neph1/llama-3-instruct-bellman-8b-swedish" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "neph1/llama-3-instruct-bellman-8b-swedish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
- SGLang
How to use neph1/llama-3-instruct-bellman-8b-swedish 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 "neph1/llama-3-instruct-bellman-8b-swedish" \ --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": "neph1/llama-3-instruct-bellman-8b-swedish", "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 "neph1/llama-3-instruct-bellman-8b-swedish" \ --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": "neph1/llama-3-instruct-bellman-8b-swedish", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use neph1/llama-3-instruct-bellman-8b-swedish with Ollama:
ollama run hf.co/neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
- Unsloth Desktop
- Docker Model Runner
How to use neph1/llama-3-instruct-bellman-8b-swedish with Docker Model Runner:
docker model run hf.co/neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
- Lemonade
How to use neph1/llama-3-instruct-bellman-8b-swedish with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull neph1/llama-3-instruct-bellman-8b-swedish:Q3_K_M
Run and chat with the model
lemonade run user.llama-3-instruct-bellman-8b-swedish-Q3_K_M
List all available models
lemonade list
- Atomic Chat
Model Card for Bellman
This version of bellman is finetuned from llama-3-instruct-8b. It is arguable whether it's better at Swedish, because llama-3 is really good. It's however finetuned for prompt question answering, based on a dataset created from Swedish wikipedia, with a lot of Sweden-centric questions. New from previous versions is questions from a translated code-feedback dataset, as well as a number of stories. It's not great at generating stories, but better than previosly.
Please note, the HuggingFace inference api is probably trying to load the adapter (lora) which isn't going to work.
240609: I've uploaded a 4-bit GPTQ quant, but it's completely untested.
Model Details
Training run on 240606:
Step Training Loss Validation Loss
25 1.506400 1.164538
50 1.128500 1.059316
75 1.095100 1.040511
100 1.068700 1.031033
125 1.061300 1.024377
150 1.035700 1.017490
175 1.061200 1.012095
200 1.031600 1.007867
225 1.031900 1.002652
250 0.958300 1.003817
275 0.967900 1.000483
300 0.950000 0.998807
325 0.974300 0.996894
350 0.960700 0.994098
375 0.956000 0.991491
400 0.940500 0.988697
425 0.949100 0.987253
450 0.940600 0.986425 <-- Picked checkpoint
475 0.888300 0.994204
500 0.881700 0.994897
Model Description
- Developed by: Me
- Funded by: Me
- Model type: Instruct
- Language(s) (NLP): Swedish
- License: llama-3
- Finetuned from model: Llama3 Instruct 8b
Model Card Contact
- Downloads last month
- 68
