Instructions to use teknium/airoboros-mistral2.2-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use teknium/airoboros-mistral2.2-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="teknium/airoboros-mistral2.2-7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("teknium/airoboros-mistral2.2-7b") model = AutoModelForCausalLM.from_pretrained("teknium/airoboros-mistral2.2-7b", device_map="auto") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use teknium/airoboros-mistral2.2-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "teknium/airoboros-mistral2.2-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teknium/airoboros-mistral2.2-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/teknium/airoboros-mistral2.2-7b
- SGLang
How to use teknium/airoboros-mistral2.2-7b 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 "teknium/airoboros-mistral2.2-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teknium/airoboros-mistral2.2-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "teknium/airoboros-mistral2.2-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "teknium/airoboros-mistral2.2-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use teknium/airoboros-mistral2.2-7b with Docker Model Runner:
docker model run hf.co/teknium/airoboros-mistral2.2-7b
How to convert to GGUF?
Hi there! I am quite new to converting models, so please excuse me if i'm doing something totally wrong in the first place.
I want to run this airoboros-trained version using ollama.ai/llama.cpp which requires a gguf version as it seems.
So far, I've downloaded the model and tried to start the conversion process like so:
python llama.cpp/convert.py airoboros-mistral2.2-7b --outfile airoboros-mistral2.2-7b.gguf
However, I am getting the following error back:
Loading model file airoboros-mistral2.2-7b\pytorch_model-00001-of-00002.bin
Loading model file airoboros-mistral2.2-7b\pytorch_model-00001-of-00002.bin
Loading model file airoboros-mistral2.2-7b\pytorch_model-00002-of-00002.bin
params = Params(n_vocab=32000, n_embd=4096, n_layer=32, n_ctx=32768, n_ff=14336, n_head=32, n_head_kv=8, f_norm_eps=1e-05, f_rope_freq_base=10000.0, f_rope_scale=None, ftype=None, path_model=WindowsPath('airoboros-mistral2.2-7b'))
Loading vocab file 'airoboros-mistral2.2-7b\tokenizer.model', type 'spm'
Traceback (most recent call last):
File "C:\Users\spaceemotion\code\gguf\llama.cpp\convert.py", line 1193, in <module>
main()
File "C:\Users\spaceemotion\code\gguf\llama.cpp\convert.py", line 1175, in main
vocab = load_vocab(vocab_dir, args.vocabtype)
File "C:\Users\spaceemotion\code\gguf\llama.cpp\convert.py", line 1086, in load_vocab
return SentencePieceVocab(path, added_tokens_path if added_tokens_path.exists() else None)
File "C:\Users\spaceemotion\code\gguf\llama.cpp\convert.py", line 372, in __init__
raise Exception(f"Expected added token IDs to be sequential and start at {len(added_tokens)}; got {actual_ids}")
Exception: Expected added token IDs to be sequential and start at 3; got [0, 1, 2]
Is this something because of my setup or how can I go about fixing this? Thanks in advance!
The bloke has already done it and uploaded it here: https://huggingface.co/TheBloke/airoboros-mistral2.2-7B-GGUF. You might have better luck asking there or in their discord server.
The bloke has already done it and uploaded it here: https://huggingface.co/TheBloke/airoboros-mistral2.2-7B-GGUF. You might have better luck asking there or in their discord server.
Oh nice, thank you @TheBloke :]
Did you end up finding out how they did it?