Official

meta / meta-llama-3.1-405b-instruct

Meta's flagship 405 billion parameter language model, fine-tuned for chat completions (Updated 10 months, 3 weeks ago)

  • Public
  • 5.8M runs
  • Priced by multiple properties
  • GitHub
  • License
Iterate in playground

Input

string
Shift + Return to add a new line

Prompt

Default: ""

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. Ignored for non-chat models.

Default: "You are a helpful assistant."

integer

The minimum number of tokens the model should generate as output.

Default: 0

integer

The maximum number of tokens the model should generate as output.

Default: 512

number

The value used to modulate the next token probabilities.

Default: 0.6

number

A probability threshold for generating the output. If < 1.0, only keep the top tokens with cumulative probability >= top_p (nucleus filtering). Nucleus filtering is described in Holtzman et al. (http://arxiv.org/abs/1904.09751).

Default: 0.9

integer

The number of highest probability tokens to consider for generating the output. If > 0, only keep the top k tokens with highest probability (top-k filtering).

Default: 50

number

Presence penalty

Default: 0

number

Frequency penalty

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>'.

string
Shift + Return to add a new line

A template to format the prompt with. If not provided, the default prompt template will be used.

Output

**Language Definition** Name: `STK` * `push` instruction: `p` * `pop` instruction: `o` * `add` instruction: `+` * `sub` instruction: `-` * `mul` instruction: `*` * `div` instruction: `/` * `jump` instruction: `j` * `halt` instruction: `h` **PLY Parser** ```python import ply.lex as lex import ply.yacc as yacc # Lexer tokens = ['PUSH', 'POP', 'ADD', 'SUB', 'MUL', 'DIV', 'JUMP', 'HALT', 'NUMBER'] t_PUSH = r'p' t_POP = r'o' t_ADD = r'\+' t_SUB = r'-' t_MUL = r'\*' t_DIV = r'/' t_JUMP = r'j' t_HALT = r'h' t_NUMBER = r'\d+' # Parser def p_program(p): '''program : instruction_list''' p[0] = p[1] def p_instruction_list(p): '''instruction_list : instruction instruction_list | instruction''' if len(p) == 3: p[0] = [p[1]] + p[2] else: p[0] = [p[1]] def p_instruction(p): '''instruction : PUSH NUMBER | POP | ADD | SUB | MUL | DIV | JUMP NUMBER | HALT''' if len(p) == 3: p[0] = (p[1], int(p[2])) else: p[0] = (p[1],) # Build parser lexer = lex.lex() parser = yacc.yacc() ``` **Language Runtime** ```python class STKRuntime: def __init__(self, program): self.program = program self.pc = 0 self.stack = [] def run(self): while self.pc < len(self.program): op, *args = self.program[self.pc] self.pc += 1 if op == 'p': self.stack.append(args[0]) elif op == 'o': self.stack.pop() elif op == '+': b = self.stack.pop() a = self.stack.pop() self.stack.append(a + b) elif op == '-': b = self.stack.pop() a = self.stack.pop() self.stack.append(a - b) elif op == '*': b = self.stack.pop() a = self.stack.pop() self.stack.append(a * b) elif op == '/': b = self.stack.pop() a = self.stack.pop() self.stack.append(a // b) elif op == 'j': self.pc = args[0] elif op == 'h': break def get_result(self): return self.stack[-1] if self.stack else None # Example usage program = parser.parse('p 2 p 3 +') runtime = STKRuntime(program) runtime.run() print(runtime.get_result()) # Output: 5 ``` **More Examples** * Fibonacci sequence: `p 0 p 1 p 10 j 5 h 5 o o + p 1 j 3 h 3 o o p 1 + j 5` * Factorial: `p 5 p 1 j 3 h 3 o o * p 1 + j 3`
Generated in
Input tokens
45
Output tokens
750
Tokens per second
30.06 tokens / second
Time to first token

Readme

Meta Llama 3.1 405B Instruct is an instruction-tuned generative language model developed by Meta. It is optimized for multilingual dialogue use cases and outperform many of the available open source and closed chat models on common industry benchmarks. Supported languages are English, German, French, Italian, Portuguese, Hindi, Spanish, and Thai.

The model is trained on over 15 trillion tokens from a mix of publicly available online data, consisting of multilingual text and code. The cutoff date in the dataset is December 2023. The model was trained for 30.84 million GPU hours.

For additional details, please refer to the official model card: https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md