Instructions to use nex-agi/Nex-N2.5-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nex-agi/Nex-N2.5-mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nex-agi/Nex-N2.5-mini") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("nex-agi/Nex-N2.5-mini") model = AutoModelForMultimodalLM.from_pretrained("nex-agi/Nex-N2.5-mini", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nex-agi/Nex-N2.5-mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nex-agi/Nex-N2.5-mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nex-agi/Nex-N2.5-mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nex-agi/Nex-N2.5-mini
- SGLang
How to use nex-agi/Nex-N2.5-mini 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 "nex-agi/Nex-N2.5-mini" \ --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": "nex-agi/Nex-N2.5-mini", "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 "nex-agi/Nex-N2.5-mini" \ --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": "nex-agi/Nex-N2.5-mini", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nex-agi/Nex-N2.5-mini with Docker Model Runner:
docker model run hf.co/nex-agi/Nex-N2.5-mini
Model tries too hard and goes wrong.
Had it for less then a houre and I see it go wrong every time.
Basic question answering it does perfectly.
But for example I integrated it into Hermes agent, it goes insane.
I see this happen in some models that are 'optimised for agentic use'. They are soo optimised they can't think straight anymore. Instead of going from point A to B, it wants to see the whole alphabet to know that A and B are right next to eachother, and surely not mentioned nowhere else.
Asking to read and summary a few txt files, for some reason it starts reading 3 different skills, does some python executions I think to find the files even tho I said where the files were.
To then find the files, and for some reason delegate and spin up agents to read and summarise these files.
After an houre of seeing these agents (it's own model) go back and forth for an houre I stopped it.
I ask it to find file A (yaml file) and change a value in that file.
it first starts to read every possible Skill that might have to do with that file, where 1 is relevant, the other the 5 others aren't relevant.
Then it finds the yaml file via the most insane search queries while the path is already mentioned in the skills he read.
When he finely finds it, it reads a part of the file.
For some reason it starts to read the '.py' files associated to the values it finds inside, not even relevant ones to the value I asked to change.
Then it does read a '.py' file, but the last 100 lines of a 2000+ line file. That is relevant to the value I asked to simply change.
Then it reads yet another '.py' file not relevant to the value I asked to change.
It somehow starts searching for other relevant files containing the value I asked to change in that 1 yaml file.
Reads another '.py' file, before then finely comming back to the right Yaml file.
And that is where I stopped it.
End result, this model might be good for some very specific and very guardrailed work. Cronjobs or something, but it is far from good for general agent use like in my case in Hermes.
you're not alone in this, I'm facing the same issues.
Similar behaviour for me. I was running it at Q4-K-S but without KV cache quantisation. Maybe this model is really sensitive to being quantized