Instructions to use Menlo/Jan-nano-128k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Menlo/Jan-nano-128k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Menlo/Jan-nano-128k") 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("Menlo/Jan-nano-128k") model = AutoModelForCausalLM.from_pretrained("Menlo/Jan-nano-128k", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Menlo/Jan-nano-128k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Menlo/Jan-nano-128k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Menlo/Jan-nano-128k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Menlo/Jan-nano-128k
- SGLang
How to use Menlo/Jan-nano-128k 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 "Menlo/Jan-nano-128k" \ --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": "Menlo/Jan-nano-128k", "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 "Menlo/Jan-nano-128k" \ --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": "Menlo/Jan-nano-128k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Menlo/Jan-nano-128k with Docker Model Runner:
docker model run hf.co/Menlo/Jan-nano-128k
Commit History
-
Update README.md
Verified signaturef731a56 -
Update README.md
Verified signature93ca07b -
Update README.md
Verified signature67035a7 -
Update README.md
Verified signaturee04e5f2
-
Update README.md
Verified signaturee9a1fcc -
Update README.md
Verified signature11772c9 -
Update README.md
Verified signature40bd2bb
-
Update config.json
Verified signature85e5cdc -
Update generation_config.json
Verified signature2c70d61
-
Update README.md (#4)
Verified signature- Update README.md (f271acdb30d30f6634650996a79b58e5ce110d5e) Co-authored-by: Dennis <qplab01@users.noreply.huggingface.co>4fe1f18 -
Adds the `transformers` tag so the snippet works (#3)
Verified signature- Adds the `transformers` tag so the snippet works (2ab6befc4a814e63daaaa313492a7eac9ccb6d89) Co-authored-by: Lysandre <lysandre@users.noreply.huggingface.co>b182d7d -
Update README.md
Verified signaturebd5fafa -
Update README.md
Verified signature25d1eed -
Update README.md
Verified signature3b45993 -
Update README.md
Verified signature05619a1
-
Update README.md
Verified signature089e37c -
Update generation_config.json
Verified signature9a9be4b -
Update README.md
Verified signature1d2a61c -
Update config.json
Verified signatureca74c33 -
Update config.json
Verified signature3fd9df0 -
Upload replay.gif
Verified signaturecdfe882 -
Delete replay.gif
Verified signature44f5a23 -
Upload replay.gif
Verified signature0e61ca3 -
Update tokenizer_config.json
Verified signature61fc14c -
Update README.md
Verified signatureb44552a -
Upload tokenizer
Verified signature31f34ee -
Upload Qwen3ForCausalLM
Verified signature6e87356 -
initial commit
Verified signature793a174