Instructions to use unsloth/codellama-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/codellama-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/codellama-7b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/codellama-7b") model = AutoModelForCausalLM.from_pretrained("unsloth/codellama-7b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/codellama-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/codellama-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/codellama-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/unsloth/codellama-7b
- SGLang
How to use unsloth/codellama-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 "unsloth/codellama-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": "unsloth/codellama-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 "unsloth/codellama-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": "unsloth/codellama-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/codellama-7b with Docker Model Runner:
docker model run hf.co/unsloth/codellama-7b
Commit History
-
Upload tokenizer
Verified signature52ad3b7 -
Upload config
Verified signaturedaed14f -
Upload config
Verified signature83122d7
-
Upload tokenizer
Verified signature99af808 -
Upload config
Verified signature1d7e4d4 -
Upload config
Verified signature5ca14c5
-
Upload tokenizer
Verified signature0b69781 -
Upload config
Verified signaturec0f955d -
Upload config
Verified signaturebe47f07
-
Upload tokenizer
Verified signature5f343be -
Upload config
Verified signature2049895 -
Upload config
Verified signature290fb83
-
Upload tokenizer
Verified signature4ae8455 -
Upload config
Verified signaturec657f45 -
Upload config
Verified signature7bd29c8
-
Upload tokenizer
Verified signature3274444 -
Upload config
Verified signaturec50cbe6 -
Upload config
Verified signatured1ba0a5
-
Upload tokenizer
Verified signature2924bc7 -
Upload config
Verified signaturef664368 -
Upload config
Verified signature9e9fca0
-
Upload tokenizer
Verified signature4d515cf -
Upload config
Verified signature20828c3 -
Upload config
Verified signatureaf10745 -
Upload tokenizer
Verified signatureff27605 -
Upload config
Verified signature3558bd8 -
Upload config
Verified signature2c34573 -
Upload tokenizer
Verified signature51337e6 -
Upload config
Verified signature92de36d -
Upload config
Verified signature28e50d6
-
Upload tokenizer
Verified signature86bd52f -
Upload LlamaForCausalLM
Verified signaturef2d25c1
-
Update README.md
Verified signatureb4296ba -
Update README.md
Verified signaturedf1ba64
-
Upload tokenizer
Verified signatureaad3c0f -
Upload LlamaForCausalLM
Verified signature3ceca57 -
initial commit
Verified signatureea7d352