Text Generation
Transformers
English
llama
llama-3.1
meta
inference-endpoints
custom-handler
conversational
Instructions to use ericaRC/test-Llama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ericaRC/test-Llama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ericaRC/test-Llama") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ericaRC/test-Llama", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ericaRC/test-Llama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ericaRC/test-Llama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ericaRC/test-Llama", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ericaRC/test-Llama
- SGLang
How to use ericaRC/test-Llama 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 "ericaRC/test-Llama" \ --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": "ericaRC/test-Llama", "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 "ericaRC/test-Llama" \ --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": "ericaRC/test-Llama", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ericaRC/test-Llama with Docker Model Runner:
docker model run hf.co/ericaRC/test-Llama
Commit History
-
Bundle Llama 3.1 tokenizer locally; speed up cold start
- Add tokenizer.json / tokenizer_config.json / special_tokens_map.json downloaded from meta-llama/Meta-Llama-3.1-8B-Instruct (v4.x-compatible PreTrainedTokenizerFast format, with Llama 3.1 chat template embedded). - handler.py now loads the tokenizer from the endpoint's local path instead of re-downloading from the base repo on every boot; weights still come from meta-llama/... via HF_TOKEN. - Track tokenizer.json via Git LFS (matches upstream convention). Co-authored-by: Cursor <cursoragent@cursor.com>802eb23 -
Make repo HF Inference Endpoint ready
- Pin transformers==4.51.3 (toolkit imports break on 5.x due to removed transformers.file_utils helpers); add accelerate + huggingface_hub. - Rewrite handler.py: use __call__ (the toolkit never invoked handle), load meta-llama/Meta-Llama-3.1-8B-Instruct at runtime via HF_TOKEN instead of the empty local repo path, and add generation parameters. - Remove local tokenizer.json / tokenizer_config.json / chat_template.jinja (v5-format "TokenizersBackend" config would crash under transformers 4.x, and the base model's tokenizer is now loaded at runtime instead). - Rewrite README.md with proper YAML front-matter (license: llama3.1, base_model, pipeline_tag), deploy instructions, and request schema. Co-authored-by: Cursor <cursoragent@cursor.com>7a117b6
-
Upload handler.py with huggingface_hub
Verified signature48c3c18