# How do I send system prompts using inference api serverless, llama3 8b instruct model

**URL:** <https://discuss.huggingface.co/t/how-do-i-send-system-prompts-using-inference-api-serverless-llama3-8b-instruct-model/83639>\
**Category:** Beginners\
**Created:** [April 25, 2024, 3:51am UTC](https://discuss.huggingface.co/t/how-do-i-send-system-prompts-using-inference-api-serverless-llama3-8b-instruct-model/83639 "2024-04-25T03:51:37Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![marcoguerrap](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@marcoguerrap](https://discuss.huggingface.co/u/marcoguerrap)\
**Post date:** [April 28, 2024, 3:38pm UTC](https://discuss.huggingface.co/t/how-do-i-send-system-prompts-using-inference-api-serverless-llama3-8b-instruct-model/83639/2 "2024-04-28T15:38:08Z")

</div>

Hey I found this post that helped me:

> [@Formatting Inference API call for LLama 2](https://discuss.huggingface.co/t/formatting-inference-api-call-for-llama-2/54901/3):
>
> I solved it by inputting a single string using the official Llama 2 format (see [Llama 2 is here - get it on Hugging Face](https://huggingface.co/blog/llama2#how-to-prompt-llama-2)). I don’t know why the default Sagemaker Llama endpoint doesn’t work that way. But this works for me: import json import requests API\_URL = "https://api-inference.huggingface.co/models/meta-llama/Llama-2-7b-chat-hf" headers = {"Authorization": f"Bearer hf\_XXXXXXXXXXXXXXXXXX", "Content-Type": "application/json",} def query(payload): json\_body = { "inputs":…

---

_[View the full topic](https://discuss.huggingface.co/t/how-do-i-send-system-prompts-using-inference-api-serverless-llama3-8b-instruct-model/83639)._
