|
| 1 | +# Llama3 8B Instruct |
| 2 | + |
| 3 | +## 📖 Introduction |
| 4 | + |
| 5 | +Meta developed and released the Meta [Llama 3](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) family of large language models (LLMs), a collection of pretrained and instruction tuned generative text models in 8 and 70B sizes. The Llama 3 instruction tuned models are optimized for dialogue use cases and outperform many of the available open source chat models on common industry benchmarks. |
| 6 | + |
| 7 | +| Task Type | Description | |
| 8 | +| -------------------------------------------------------- | ------------------------------------------------------------------------------------------- | |
| 9 | +| [Chat](https://www.instill.tech/docs/model/ai-task#chat) | A task to generate conversational style text output base on single or multi-modality input. | |
| 10 | + |
| 11 | +## 🔄 Compatibility Matrix |
| 12 | + |
| 13 | +To ensure smooth integration, please refer to the compatibility matrix below. It outlines the compatible versions of the model, [`instill-core`](https://github.com/instill-ai/instill-core), and the [`python-sdk`](https://github.com/instill-ai/python-sdk). |
| 14 | + |
| 15 | +| Model Version | Instill-Core Version | Python-SDK Version | |
| 16 | +| ------------- | -------------------- | ------------------ | |
| 17 | +| v0.1.0 | >v0.39.0-beta | >0.11.0 | |
| 18 | + |
| 19 | +> **Note:** Always ensure that you are using compatible versions to avoid unexpected issues. |
| 20 | +
|
| 21 | +## 🚀 Preparation |
| 22 | + |
| 23 | +Follow [this](../README.md) guide to get your custom model up and running! But before you do that, please read through the following sections to have all the necessary files ready. |
| 24 | + |
| 25 | +#### Install Python SDK |
| 26 | + |
| 27 | +Install the compatible [`python-sdk`](https://github.com/instill-ai/python-sdk) version according to the compatibility matrix: |
| 28 | + |
| 29 | +```bash |
| 30 | +pip install instill-sdk=={version} |
| 31 | +``` |
| 32 | + |
| 33 | +#### Get model weights |
| 34 | + |
| 35 | +To download the fine-tuned model weights, please execute the following command: |
| 36 | + |
| 37 | +```bash |
| 38 | +git clone https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct |
| 39 | +``` |
| 40 | + |
| 41 | +## Test model image |
| 42 | + |
| 43 | +After you've built the model image, and before pushing the model onto any **Instill Core** instance, you can test if the model can be successfully run locally first, by running the following command: |
| 44 | + |
| 45 | +```bash |
| 46 | +instill run instill-ai/llama3-8b-instruct -g -i '{"prompt": "hows life?"}' |
| 47 | +``` |
| 48 | + |
| 49 | +The input payload should strictly follow the the below format |
| 50 | + |
| 51 | +```json |
| 52 | +{ |
| 53 | + "prompt": "..." |
| 54 | +} |
| 55 | +``` |
| 56 | + |
| 57 | +A successful response will return a similar output to that shown below. |
| 58 | + |
| 59 | +```bash |
| 60 | +2024-09-11 01:48:37,795.795 INFO [Instill] Starting model image... |
| 61 | +2024-09-11 01:48:48,785.785 INFO [Instill] Deploying model... |
| 62 | +2024-09-11 01:49:28,613.613 INFO [Instill] Running inference... |
| 63 | +2024-09-11 01:49:33,350.350 INFO [Instill] Outputs: |
| 64 | +[{'data': {'choices': [{'created': 1725990573, |
| 65 | + 'finish-reason': 'length', |
| 66 | + 'index': 0, |
| 67 | + 'message': {'content': "I'm just an AI, I don't have a " |
| 68 | + 'life in the classical sense. I ' |
| 69 | + 'exist solely to assist and ' |
| 70 | + 'communicate with users like ' |
| 71 | + "you. I don't have emotions, " |
| 72 | + 'experiences, or personal ' |
| 73 | + "relationships. I'm just a " |
| 74 | + 'collection of code and data', |
| 75 | + 'role': 'assistant'}}]}}] |
| 76 | +2024-09-11 01:49:37,114.114 INFO [Instill] Done |
| 77 | +``` |
| 78 | + |
| 79 | +Here is the list of flags supported by `instill run` command |
| 80 | + |
| 81 | +- -t, --tag: tag for the model image, default to `latest` |
| 82 | +- -g, --gpu: to pass through GPU from host into container or not, depends on if `gpu` is enabled in the config. |
| 83 | +- -i, --input: input in json format |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +Happy Modeling! 💡 |
0 commit comments