Text Generation
Transformers
Safetensors
English
llama
meta
llama-3
conversational
text-generation-inference
Run this model with HF Jobs
Run gradientai/Llama-3-8B-Instruct-Gradient-1048k on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use gradientai/Llama-3-8B-Instruct-Gradient-1048k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gradientai/Llama-3-8B-Instruct-Gradient-1048k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gradientai/Llama-3-8B-Instruct-Gradient-1048k") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gradientai/Llama-3-8B-Instruct-Gradient-1048k") model = AutoModelForCausalLM.from_pretrained("gradientai/Llama-3-8B-Instruct-Gradient-1048k", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gradientai/Llama-3-8B-Instruct-Gradient-1048k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gradientai/Llama-3-8B-Instruct-Gradient-1048k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gradientai/Llama-3-8B-Instruct-Gradient-1048k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k
- SGLang
How to use gradientai/Llama-3-8B-Instruct-Gradient-1048k 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 "gradientai/Llama-3-8B-Instruct-Gradient-1048k" \ --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": "gradientai/Llama-3-8B-Instruct-Gradient-1048k", "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 "gradientai/Llama-3-8B-Instruct-Gradient-1048k" \ --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": "gradientai/Llama-3-8B-Instruct-Gradient-1048k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gradientai/Llama-3-8B-Instruct-Gradient-1048k with Docker Model Runner:
docker model run hf.co/gradientai/Llama-3-8B-Instruct-Gradient-1048k
Create License
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117META LLAMA 3 COMMUNITY LICENSE AGREEMENTMeta Llama 3 Version Release Date: April 18, 2024
“Agreement” means the terms and conditions for use, reproduction, distribution and modification of theLlama Materials set forth herein.
“Documentation” means the specifications, manuals and documentation accompanying Meta Llama 3distributed by Meta at https://llama.meta.com/get-started/.
“Licensee” or “you” means you, or your employer or any other person or entity (if you are entering intothis Agreement on such person or entity’s behalf), of the age required under applicable laws, rules orregulations to provide legal consent and that has legal authority to bind your employer or such otherperson or entity if you are entering in this Agreement on their behalf.
“Meta Llama 3” means the foundational large language models and software and algorithms, includingmachine-learning model code, trained model weights, inference-enabling code, training-enabling code,fine-tuning enabling code and other elements of the foregoing distributed by Meta athttps://llama.meta.com/llama-downloads.
“Llama Materials” means, collectively, Meta’s proprietary Meta Llama 3 and Documentation (and anyportion thereof) made available under this Agreement.
“Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or, if you are an entity, yourprincipal place of business is in the EEA or Switzerland) and Meta Platforms, Inc. (if you are locatedoutside of the EEA or Switzerland).
By clicking “I Accept” below or by using or distributing any portion or element of the Llama Materials,you agree to be bound by this Agreement.
1. License Rights and Redistribution.
a. Grant of Rights. You are granted a non-exclusive, worldwide, non-transferable and royalty-freelimited license under Meta’s intellectual property or other rights owned by Meta embodied in the LlamaMaterials to use, reproduce, distribute, copy, create derivative works of, and make modifications to theLlama Materials.
b. Redistribution and Use.
i. If you distribute or make available the Llama Materials (or any derivative worksthereof), or a product or service that uses any of them, including another AI model, you shall (A) providea copy of this Agreement with any such Llama Materials; and (B) prominently display “Built with MetaLlama 3” on a related website, user interface, blogpost, about page, or product documentation. If youuse the Llama Materials to create, train, fine tune, or otherwise improve an AI model, which isdistributed or made available, you shall also include “Llama 3” at the beginning of any such AI modelname.
ii. If you receive Llama Materials, or any derivative works thereof, from a Licensee as part of an integrated end user product, then Section 2 of this Agreement will not apply to you.
iii. You must retain in all copies of the Llama Materials that you distribute the followingattribution notice within a “Notice” text file distributed as a part of such copies: “Meta Llama 3 islicensed under the Meta Llama 3 Community License, Copyright © Meta Platforms, Inc. All RightsReserved.”
iv. Your use of the Llama Materials must comply with applicable laws and regulations(including trade compliance laws and regulations) and adhere to the Acceptable Use Policy for the LlamaMaterials (available at https://llama.meta.com/llama3/use-policy), which is hereby incorporated byreference into this Agreement.
v. You will not use the Llama Materials or any output or results of the Llama Materials toimprove any other large language model (excluding Meta Llama 3 or derivative works thereof).
2. Additional Commercial Terms. If, on the Meta Llama 3 version release date, the monthly active usersof the products or services made available by or for Licensee, or Licensee’s affiliates, is greater than 700million monthly active users in the preceding calendar month, you must request a license from Meta,which Meta may grant to you in its sole discretion, and you are not authorized to exercise any of therights under this Agreement unless or until Meta otherwise expressly grants you such rights.
3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE LLAMA MATERIALS AND ANYOUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS” BASIS, WITHOUT WARRANTIES OFANY KIND, AND META DISCLAIMS ALL WARRANTIES OF ANY KIND, BOTH EXPRESS AND IMPLIED,INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OF TITLE, NON-INFRINGEMENT,MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FORDETERMINING THE APPROPRIATENESS OF USING OR REDISTRIBUTING THE LLAMA MATERIALS ANDASSUME ANY RISKS ASSOCIATED WITH YOUR USE OF THE LLAMA MATERIALS AND ANY OUTPUT ANDRESULTS.
4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE UNDER ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS LIABILITY, OR OTHERWISE, ARISINGOUT OF THIS AGREEMENT, FOR ANY LOST PROFITS OR ANY INDIRECT, SPECIAL, CONSEQUENTIAL,INCIDENTAL, EXEMPLARY OR PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISEDOF THE POSSIBILITY OF ANY OF THE FOREGOING.
5. Intellectual Property.
a. No trademark licenses are granted under this Agreement, and in connection with the LlamaMaterials, neither Meta nor Licensee may use any name or mark owned by or associated with the otheror any of its affiliates, except as required for reasonable and customary use in describing andredistributing the Llama Materials or as set forth in this Section 5(a). Meta hereby grants you a license touse “Llama 3” (the “Mark”) solely as required to comply with the last sentence of Section 1.b.i. You willcomply with Meta’s brand guidelines (currently accessible athttps://about.meta.com/brand/resources/meta/company-brand/ ). All goodwill arising out of your useof the Mark will inure to the benefit of Meta.
b. Subject to Meta’s ownership of Llama Materials and derivatives made by or for Meta, withrespect to any derivative works and modifications of the Llama Materials that are made by you, asbetween you and Meta, you are and will be the owner of such derivative works and modifications.
c. If you institute litigation or other proceedings against Meta or any entity (including across-claim or counterclaim in a lawsuit) alleging that the Llama Materials or Meta Llama 3 outputs orresults, or any portion of any of the foregoing, constitutes infringement of intellectual property or otherrights owned or licensable by you, then any licenses granted to you under this Agreement shallterminate as of the date such litigation or claim is filed or instituted. You will indemnify and holdharmless Meta from and against any claim by any third party arising out of or related to your use ordistribution of the Llama Materials.
6. Term and Termination. The term of this Agreement will commence upon your acceptance of thisAgreement or access to the Llama Materials and will continue in full force and effect until terminated inaccordance with the terms and conditions herein. Meta may terminate this Agreement if you are inbreach of any term or condition of this Agreement. Upon termination of this Agreement, you shall deleteand cease use of the Llama Materials. Sections 3, 4 and 7 shall survive the termination of thisAgreement.
7. Governing Law and Jurisdiction. This Agreement will be governed and construed under the laws ofthe State of California without regard to choice of law principles, and the UN Convention on Contractsfor the International Sale of Goods does not apply to this Agreement. The courts of California shall haveexclusive jurisdiction of any dispute arising out of this Agreement.LicenseAdded+117