Instructions to use ltg/normistral-7b-warm-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ltg/normistral-7b-warm-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ltg/normistral-7b-warm-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ltg/normistral-7b-warm-instruct") model = AutoModelForCausalLM.from_pretrained("ltg/normistral-7b-warm-instruct", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ltg/normistral-7b-warm-instruct 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 ltg/normistral-7b-warm-instruct:Q4_K_M # Run inference directly in the terminal: llama cli -hf ltg/normistral-7b-warm-instruct:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ltg/normistral-7b-warm-instruct:Q4_K_M # Run inference directly in the terminal: llama cli -hf ltg/normistral-7b-warm-instruct:Q4_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 ltg/normistral-7b-warm-instruct:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ltg/normistral-7b-warm-instruct:Q4_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 ltg/normistral-7b-warm-instruct:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ltg/normistral-7b-warm-instruct:Q4_K_M
Use Docker
docker model run hf.co/ltg/normistral-7b-warm-instruct:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ltg/normistral-7b-warm-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ltg/normistral-7b-warm-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ltg/normistral-7b-warm-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ltg/normistral-7b-warm-instruct:Q4_K_M
- SGLang
How to use ltg/normistral-7b-warm-instruct 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 "ltg/normistral-7b-warm-instruct" \ --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": "ltg/normistral-7b-warm-instruct", "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 "ltg/normistral-7b-warm-instruct" \ --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": "ltg/normistral-7b-warm-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use ltg/normistral-7b-warm-instruct with Ollama:
ollama run hf.co/ltg/normistral-7b-warm-instruct:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use ltg/normistral-7b-warm-instruct with Docker Model Runner:
docker model run hf.co/ltg/normistral-7b-warm-instruct:Q4_K_M
- Lemonade
How to use ltg/normistral-7b-warm-instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ltg/normistral-7b-warm-instruct:Q4_K_M
Run and chat with the model
lemonade run user.normistral-7b-warm-instruct-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Will there be quantized GGUF for the instruct model as well?
Having briefly tested the warm model, it is apparent that it is a bit all over the place (but very funny!). It would be great if the instruct model was released as GGUF as well.
I believe Lucas is also working on that :) We found the default hyperparameters of llama-cpp a bit strange, it was better to turn off the repetition penalty (set it to 1.0) and to set the temperature to a lower value; the model behaved very chaotically otherwise. I'm sure there's more that can be done about these (and other) hyperparameters, they influence the outputs more than I'd like.
First: Thank you very much for providing gguf-files for the instruct model. It made the life for us amateurs a little more easy. 🤩
I am a total beginner and are experimenting a little with the instruct-model on Ollama. Does anyone have som tips for parameter setting that works well?
Currently my Ollama-modelfile looks like this:
TEMPLATE """
{{ if .System }}<|im_start|>system
{{ .System }}<|im_end|>{{ end }}
{{ if .Prompt }}<|im_start|>user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|>assistant
"""
SYSTEM """Du er en vennlig assistent som skal svare på spørsmål? Svar kort og konkret på spørsmål"""
PARAMETER num_ctx 4096
PARAMETER stop "<|im_end|>"
PARAMETER temperature 1
The responses are ok-ish, but I wonder if the settings/modelfile can be improved.
Here is my Modelfile using the suggestions from @davda54 and the README. I made the following changes to the Modelfile:
- a space before system, user and assistant (as suggested in the README).
- set the repeat penalty to 1.0
- the temperature to 0.3
- added extra stop parameters
TEMPLATE """
{{ if .System }}<|im_start|> system
{{ .System }}<|im_end|>{{ end }}
{{ if .Prompt }}<|im_start|> user
{{ .Prompt }}<|im_end|>
{{ end }}<|im_start|> assistant
"""
SYSTEM """Du er Kari Nordmann, en jovial og hjelpsom assistent som svarer kort og konsist på spørsmål."""
PARAMETER num_ctx 4096
PARAMETER temperature 0.3
PARAMETER repeat_penalty 1.0
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|im_start|>"
PARAMETER stop " user"
PARAMETER stop " assistant"
It behaves quite well, but it is still a bit to verbose for my taste, so I will experiment further with different system messages.
Thanks for the response @rsolva ! Verbosity is definitely a problem, we tried to augment the open instruction datasets by step-by-step reasoning, detailed descriptions, etc. and apparently we overdid it :) It's on our list of things to improve in the next release. By the way, if you noticed some other recurring unwanted patterns in the outputs, please let us know your feedback!