Instructions to use JetBrains/CodeLlama-7B-KStack with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JetBrains/CodeLlama-7B-KStack with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JetBrains/CodeLlama-7B-KStack")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("JetBrains/CodeLlama-7B-KStack") model = AutoModelForCausalLM.from_pretrained("JetBrains/CodeLlama-7B-KStack", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use JetBrains/CodeLlama-7B-KStack with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JetBrains/CodeLlama-7B-KStack" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JetBrains/CodeLlama-7B-KStack", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/JetBrains/CodeLlama-7B-KStack
- SGLang
How to use JetBrains/CodeLlama-7B-KStack 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 "JetBrains/CodeLlama-7B-KStack" \ --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": "JetBrains/CodeLlama-7B-KStack", "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 "JetBrains/CodeLlama-7B-KStack" \ --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": "JetBrains/CodeLlama-7B-KStack", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use JetBrains/CodeLlama-7B-KStack with Docker Model Runner:
docker model run hf.co/JetBrains/CodeLlama-7B-KStack
Upload tokenizer
Browse filesFiles changed (4)
- special_tokens_map.jsonAdded+33
- tokenizer.jsonAdded
- tokenizer.modelAdded+3
- tokenizer_config.jsonAdded+87
123456789101112131415161718192021222324252627282930313233{ "additional_special_tokens": [ "β<PRE>", "β<MID>", "β<SUF>", "β<EOT>", "β<PRE>", "β<MID>", "β<SUF>", "β<EOT>" ], "bos_token": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "eos_token": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "unk_token": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}123version https://git-lfs.github.com/spec/v1oid sha256:45ccb9c8b6b561889acea59191d66986d314e7cbd6a78abc6e49b139ca91c1e6size 500058123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687{ "add_bos_token": true, "add_eos_token": false, "added_tokens_decoder": { "0": { "content": "<unk>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "</s>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32007": { "content": "β<PRE>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32008": { "content": "β<SUF>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32009": { "content": "β<MID>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "32010": { "content": "β<EOT>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ "β<PRE>", "β<MID>", "β<SUF>", "β<EOT>", "β<PRE>", "β<MID>", "β<SUF>", "β<EOT>" ], "bos_token": "<s>", "clean_up_tokenization_spaces": false, "eos_token": "</s>", "eot_token": "β<EOT>", "fill_token": "<FILL_ME>", "legacy": null, "middle_token": "β<MID>", "model_max_length": 1000000000000000019884624838656, "pad_token": null, "prefix_token": "β<PRE>", "sp_model_kwargs": {}, "suffix_token": "β<SUF>", "tokenizer_class": "CodeLlamaTokenizer", "unk_token": "<unk>", "use_default_system_prompt": false}special_tokens_map.jsonAdded+33
tokenizer.jsonAdded
tokenizer.modelAdded+3
tokenizer_config.jsonAdded+87