Text Generation
Transformers
Safetensors
English
llama
unsloth
codellama
codellama-7b
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use unsloth/codellama-7b-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/codellama-7b-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/codellama-7b-bnb-4bit")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/codellama-7b-bnb-4bit") model = AutoModelForCausalLM.from_pretrained("unsloth/codellama-7b-bnb-4bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/codellama-7b-bnb-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/codellama-7b-bnb-4bit" # 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-bnb-4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/unsloth/codellama-7b-bnb-4bit
- SGLang
How to use unsloth/codellama-7b-bnb-4bit 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-bnb-4bit" \ --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-bnb-4bit", "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-bnb-4bit" \ --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-bnb-4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/codellama-7b-bnb-4bit with Docker Model Runner:
docker model run hf.co/unsloth/codellama-7b-bnb-4bit
Commit History
-
Upload tokenizer
Verified signatureee00fa4 -
Upload config
Verified signatureda27e52 -
Upload config
Verified signaturec6b474d
-
Upload tokenizer
Verified signaturee05f3df -
Upload config
Verified signature9424751 -
Upload config
Verified signature48441c3
-
Upload tokenizer
Verified signature7ac2c10 -
Upload config
Verified signature0a16daa -
Upload config
Verified signatureba018d3
-
Upload tokenizer
Verified signature55448ea -
Upload config
Verified signature8cd7832 -
Upload config
Verified signature00f7699
-
Upload tokenizer
Verified signature69436f2 -
Upload config
Verified signature8c0784c -
Upload config
Verified signature5d09502
-
Upload tokenizer
Verified signature48cc1f9 -
Upload config
Verified signature5db75ae -
Upload config
Verified signatured634b81
-
Upload tokenizer
Verified signature9be441a -
Upload config
Verified signatureb60525b -
Upload config
Verified signature45c3028
-
Upload tokenizer
Verified signaturee5414f4 -
Upload config
Verified signature2a51251 -
Upload config
Verified signature430f50c -
Upload tokenizer
Verified signature8fac9e3 -
Upload config
Verified signature12ed2c3 -
Upload config
Verified signature8c49f1d -
Upload tokenizer
Verified signaturef41d17c -
Upload config
Verified signature316371d -
Upload config
Verified signature48ef5f1
-
Upload tokenizer
Verified signaturef36ad61 -
Upload LlamaForCausalLM
Verified signature1f7efee
-
Update README.md
Verified signature18dd2a3
-
Upload tokenizer
Verified signature3908334 -
Upload LlamaForCausalLM
Verified signature1133ba7 -
initial commit
Verified signature9719879