Instructions to use FriendliAI/Meta-Llama-3-8B-fp8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FriendliAI/Meta-Llama-3-8B-fp8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="FriendliAI/Meta-Llama-3-8B-fp8")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("FriendliAI/Meta-Llama-3-8B-fp8") model = AutoModelForCausalLM.from_pretrained("FriendliAI/Meta-Llama-3-8B-fp8") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use FriendliAI/Meta-Llama-3-8B-fp8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FriendliAI/Meta-Llama-3-8B-fp8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FriendliAI/Meta-Llama-3-8B-fp8", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/FriendliAI/Meta-Llama-3-8B-fp8
- SGLang
How to use FriendliAI/Meta-Llama-3-8B-fp8 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 "FriendliAI/Meta-Llama-3-8B-fp8" \ --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": "FriendliAI/Meta-Llama-3-8B-fp8", "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 "FriendliAI/Meta-Llama-3-8B-fp8" \ --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": "FriendliAI/Meta-Llama-3-8B-fp8", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use FriendliAI/Meta-Llama-3-8B-fp8 with Docker Model Runner:
docker model run hf.co/FriendliAI/Meta-Llama-3-8B-fp8
Any tutorials to run the model and checkout the ppl?
Thanks!
This model checkpoint only can be used with Friendli Container. You can find the guide to pull and run Friendli Container at https://docs.friendli.ai/guides/container/running_friendli_container.
To calculate the PPL, you need to send the inference request to the serving endpoint created by Friendli Container. You will need to use options like include_output_logprobs and forced_output_tokens.forced_output_tokens makes the serving engine generate your target tokens to compute their logprobs.
(https://docs.friendli.ai/openapi/create-completions)
Note that Friendli engine executes the actual (autoregressive) generation process. The process comprises multiple steps, where each step computes logprobs of a single next token.
This is different from and is slower than feeding an entire sequence and computing the logprobs of all of the tokens in a single step.
My trial:latest downloaded yesterday says it doesn't recognize dtype fp8.
How do I actually load / run this?
I'm actually interested in running 70B, but there weren't any posts there.
I have 3x RTX6000 Ada, CUDA 12.4, etc so should be good to go?
I'm looking for high-throughput batch biomedical text processing
Thanks.
DUH. RTFM, as they used to say. Never mind, found it.
Actually, haven't been able to get your fp8 example to work. too bad.