Official

meta / llama-2-7b-chat

A 7 billion parameter language model from Meta, fine tuned for chat completions

  • Public
  • 17.1M runs
  • Priced per token
  • GitHub
  • Paper
  • License

Input

*string
Shift + Return to add a new line

Prompt to send to the model.

string
Shift + Return to add a new line

System prompt to send to the model. This is prepended to the prompt and helps guide system behavior.

Default: "You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature.\n\nIf a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."

integer
(minimum: 1)

Maximum number of tokens to generate. A word is generally 2-3 tokens.

Default: 512

integer
(minimum: -1)

Minimum number of tokens to generate. To disable, set to -1. A word is generally 2-3 tokens.

number
(minimum: 0, maximum: 5)

Adjusts randomness of outputs, greater than 1 is random and 0 is deterministic, 0.75 is a good starting value.

Default: 0.7

number
(minimum: 0, maximum: 1)

When decoding text, samples from the top p percentage of most likely tokens; lower to ignore less likely tokens.

Default: 0.95

integer
(minimum: -1)

When decoding text, samples from the top k most likely tokens; lower to ignore less likely tokens.

Default: 0

string
Shift + Return to add a new line

A comma-separated list of sequences to stop generation at. For example, '<end>,<stop>' will stop generation at the first instance of 'end' or '<stop>'.

number
(minimum: 0, maximum: 5)

A parameter that controls how long the outputs are. If < 1, the model will tend to generate shorter outputs, and > 1 will tend to generate longer outputs.

Default: 1

number

A parameter that penalizes repeated tokens regardless of the number of appearances. As the value increases, the model will be less likely to repeat tokens in the output.

Default: 0

integer

Random seed. Leave blank to randomize the seed.

string
Shift + Return to add a new line

Template for formatting the prompt. Can be an arbitrary string, but must contain the substring `{prompt}`.

Default: "<s>[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n\n{prompt} [/INST]"

boolean

Default: false

integer
(minimum: 1)

This parameter has been renamed to max_tokens. max_new_tokens only exists for backwards compatibility purposes. We recommend you use max_tokens instead. Both may not be specified.

integer
(minimum: -1)

This parameter has been renamed to min_tokens. min_new_tokens only exists for backwards compatibility purposes. We recommend you use min_tokens instead. Both may not be specified.

Output

Of course, I'd be happy to help! Tailoring a men's suit can make a huge difference in how fashionable and put-together you look. Here are some tips to help you tailor a men's suit that will make you look stylish and fashionable: 1. Know your measurements: Before you start tailoring your suit, it's important to take your measurements to ensure a proper fit. Measure your chest, waist, inseam, and arm length to give to your tailor. 2. Choose the right fabric: The fabric of your suit can greatly impact how it looks and feels. Consider the occasion, season, and your personal style when choosing the fabric. For example, a lightweight cotton or wool suit is perfect for spring and summer, while a rich, luxurious wool suit is great for formal events. 3. Get the right fit: A well-fitted suit should skim your body without being too tight or too loose. Make sure the jacket is long enough to cover your buttocks when you stand up straight, and the pants should be long enough to reach your ankles. 4. Pay attention to the shoulders: The shoulders of your suit should be well-balanced and not too narrow or too wide. You can use a shoulder pad to add structure and definition to your shoulders if needed. 5. Take care of the details: Pay attention to the little details that can make a big difference in how your suit looks. Make sure the pants are hemmed correctly, and the jacket has a clean, even hem. 6. Get it altered: If you want to really make your suit stand out, consider getting it altered. A tailor can take in or let out the jacket and pants to fit your body perfectly, and can also make adjustments to the sleeves, collar, and pant legs. By following these tips, you can have a tailored men's suit that looks fashionable and stylish, and that you can wear with confidence. Remember to always work with a reputable tailor who can help you achieve the best results.
Generated in

Pricing

Official model
Pricing for official models works differently from other models. Instead of being billed by time, you’re billed by input and output, making pricing more predictable.

This language model is priced by how many input tokens are sent as inputs and how many output tokens are generated.

TypePer unitPer $1
Input
$0.05 / 1M tokens
or
20M tokens / $1
Output
$0.25 / 1M tokens
or
4M tokens / $1

For example, for $10 you can run around 57,143 predictions where the input is a sentence or two (15 tokens) and the output is a few paragraphs (700 tokens).

Check out our docs for more information about how per-token pricing works on Replicate.

Readme

Llama 2 is a collection of pretrained and fine-tuned generative text models ranging in scale from 7 billion to 70 billion parameters. This is the repository for the 7 billion parameter chat model, which has been fine-tuned on instructions to make it better at being a chat bot.

Learn more about running Llama 2 with an API and the different models.

Please see ai.meta.com/llama for more information about the model, licensing, and acceptable use.

How to prompt Llama 2 chat

To use this model, you can simply pass a prompt or instruction to the prompt argument. We handle prompt formatting on the backend so that you don’t need to worry about it.

Formatting prompts for chat interfaces

However, if you’re managing dialogue state with multiple exchanges between a user and the model, you need to mark the dialogue turns with instruction tags that indicate the beginning ("[INST]") and end (`”/INST]”) of user input. For example, a properly formatted dialogue looks like:

prompt = """\
[INST] Hi! [/INST]
Hello! How are you?
[INST] I'm great, thanks for asking. Could you help me with a task? [/INST]"""

In this example, the hypothetical user has first prompted "Hi!" and received the response "Hello! How are you?". Then, the user responded "I'm great, thanks for asking. Could you help me with a task?".

Modifying the system prompt

In addition to supporting dialogue exchanges, this deployment also allows you to modify the system prompt that is used to guide model responses. By altering the input to the system_prompt argument, you can inject custom context or information that will be used to guide model output.

To learn more, see this guide to prompting Llama 2.