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)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Menlo/Jan-nano-128k") model = AutoModelForCausalLM.from_pretrained("Menlo/Jan-nano-128k") 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
- 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
Local Installation Video and Testing - Step by Step
Hi,
Kudos on producing such a sublime model. I did a local installation and testing video :
https://youtu.be/2_r_1GNm4uQ?si=W5c8z3y-kD1Hsan4
Thanks and regards,
Fahd
Hi,
Wow, we have never trained it to do needle in the haystack, but if it's working out well for you it's great.
Thank you so much for following up and posting about us at each release I personally appreciate it a lot, please help yourself with more of our models + research and reach out for discord if you ever need any help.
yep working great, thank you. Sure, lets collaborate more for your future model releases. My email is fahd.mirza.c@gmail.com , thanks
@alandao tested the model for triplets graph extraction and works like a charm!
it returning huge json structures with any lm guidance framework, just pure prompting.
awesome
ex:
"triplets": [
{
"origen": "Decreto 132",
"origen_entity_type": "concept",
"relacion": "aprobó",
"destino": "Ministerio de Minería",
"destino_entity_type": "organization",
"topics": [
"Reglamentos",
"Gobierno",
"Minería"
],
"descripcion_origen": "Decreto 132 es el documento que aprueba el Reglamento de Seguridad Minera, estableciendo modificaciones y actualizaciones a las normas vigentes.",
"descripcion_destino": "El Ministerio de Minería es la organización encargada de emitir el Decreto 132 y de supervisar la aplicación del Reglamento de Seguridad Minera.",
"descripcion_relacion": "El Decreto 132 fue aprobado por el Ministerio de Minería.",
"chunk_id": 0
},
{
"origen": "Ministerio de Minería",
"origen_entity_type": "organization",
"relacion": "promulgó",
"destino": "Decreto 132",
"destino_entity_type": "concept",
"topics": [
"Reglamentos",
"Gobierno",
"Minería"
],
"descripcion_origen": "El Ministerio de Minería es la organización encargada de emitir el Decreto 132 y de supervisar la aplicación del Reglamento de Seguridad Minera.",
"descripcion_destino": "Decreto 132 es el documento que aprueba el Reglamento de Seguridad Minera, estableciendo modificaciones y actualizaciones a las normas vigentes.",
"descripcion_relacion": "El Ministerio de Minería promulgó el Decreto 132.",
"chunk_id": 0
},
{
"origen": "Decreto 132",
"origen_entity_type": "concept",
"relacion": "tiene fecha de publicación",
"destino": "Fecha de Publicación",
"destino_entity_type": "date",
"topics": [
"Fecha",
"Reglamentos",
"Minería"
],
"descripcion_origen": "Decreto 132 es el documento que aprueba el Reglamento de Seguridad Minera, estableciendo modificaciones y actualizaciones a las normas vigentes.",
"descripcion_destino": "Fecha de Publicación es la fecha en la que se publicó el Decreto 132, el 07 de febrero de 2004.",
"descripcion_relacion": "El Decreto 132 tiene fecha de publicación: 07-FEB-2004.",
"chunk_id": 0
},
{
"origen": "Decreto 132",
"origen_entity_type": "concept",
"relacion": "tiene fecha de promulgación",
"destino": "Fecha de Promulgación",
"destino_entity_type": "date",
"topics": [
"Fecha",
"Reglamentos",
"Minería"
],
"descripcion_origen": "Decreto 132 es el documento que aprueba el Reglamento de Seguridad Minera, estableciendo modificaciones y actualizaciones a las normas vigentes.",
"descripcion_destino": "Fecha de Promulgación es la fecha en la que se promulgó el Decreto 132, el 30 de diciembre de 2002.",
"descripcion_relacion": "El Decreto 132 tiene fecha de promulgación: 30-DIC-2002.",
"chunk_id": 0
},
{
"origen": "Decreto 132",
"origen_entity_type": "concept",
"relacion": "ti
......