Instructions to use facebook/layerskip-llama2-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/layerskip-llama2-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="facebook/layerskip-llama2-7B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("facebook/layerskip-llama2-7B") model = AutoModelForCausalLM.from_pretrained("facebook/layerskip-llama2-7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use facebook/layerskip-llama2-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "facebook/layerskip-llama2-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "facebook/layerskip-llama2-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/facebook/layerskip-llama2-7B
- SGLang
How to use facebook/layerskip-llama2-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 "facebook/layerskip-llama2-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": "facebook/layerskip-llama2-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 "facebook/layerskip-llama2-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": "facebook/layerskip-llama2-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use facebook/layerskip-llama2-7B with Docker Model Runner:
docker model run hf.co/facebook/layerskip-llama2-7B
Request to Reconsider Access: Academic Reproduction of PELM (SenSys '26) on NVIDIA Jetson Orin Nano Super
Hello,
My access request for facebook/layerskip-llama3.2-1B (Hugging Face username: joff2026) was recently rejected. I would like to kindly ask if my request could be reconsidered.
I am an undergraduate student at the School of Computer Science and Technology, Harbin Institute of Technology, Shenzhen (HITSZ). I am currently conducting academic research on edge LLM inference acceleration and working on reproducing the paper:
"PELM: Power Efficient On-Device LLM Inference with Speculative Decoding and Dynamic Voltage Frequency Scaling" (SenSys '26).
This paper evaluates its proposed approach on NVIDIA Jetson devices and specifically uses layerskip-llama3.2-1B in its Jetson Orin Nano experiments. The model's early-exit capability is essential to reproducing the self-speculative decoding mechanism evaluated in the paper. Therefore, access to this particular model is important for my reproduction work.
I would like to emphasize that the model will be used strictly for non-commercial academic research, in full compliance with the FAIR Noncommercial Research License. The model will be deployed and evaluated locally on my NVIDIA Jetson Orin Nano Super Developer Kit. I will not redistribute the model weights or use them for any commercial purposes.
I would be very grateful if you could reconsider my access request. I would also be happy to provide any additional information or clarification if needed.
Institutional email: 2023311e30@stu.hit.edu.cn
Thank you very much for your time and consideration, and for making the LayerSkip models available to the research community.
Best regards,
Yanheng Luo
School of Computer Science and Technology
Harbin Institute of Technology, Shenzhen (HITSZ)
Hugging Face: joff2026