Views
No views yet

ollama run ajindal/llama3.1-storm:8b
| Model Strength | Relevant Benchmarks |
| 🎯 Improved Instruction Following | IFEval Strict (+3.93%) |
| 🌐 Enhanced Knowledge Driven Question Answering | GPQA (+7.21%), MMLU-Pro (+0.55%), AGIEval (+3.77%) |
| 🧠 Better Reasoning | ARC-C (+3.92%), MuSR (+2.77%), BBH (+1.67%), AGIEval (+3.77%) |
| 🤖 Superior Agentic Capabilities | BFCL: Overall Acc (+7.92%), BFCL: AST Summary (+12.32%) |
| 🚫 Reduced Hallucinations | TruthfulQA (+9%) |
BF16: Llama-3.1-Storm-8BFP8: Llama-3.1-Storm-8B-FP8-DynamicGGUF: Llama-3.1-Storm-8B-GGUFollama run ajindal/llama3.1-storm:8btransformers library loads the model in bfloat16 by default. This is the type used by the Llama-3.1-Storm-8B checkpoint, so it’s the recommended way to run to ensure the best results.pip install --upgrade "transformers>=4.43.2" torch==2.3.1 accelerate vllm==0.5.3.post1transformers.pipeline() API1import transformers
2import torch
3model_id = "EpistemeAI2/FireStorm-Llama-3.1-8B"
4pipeline = transformers.pipeline(
5 "text-generation",
6 model=model_id,
7 model_kwargs={"torch_dtype": torch.bfloat16},
8 device_map="auto",
9)
10messages = [
11 {"role": "system", "content": "You are a helpful assistant."},
12 {"role": "user", "content": "What is 2+2?"}
13]
14outputs = pipeline(messages, max_new_tokens=128, do_sample=True, temperature=0.01, top_k=100, top_p=0.95)
15print(outputs[0]["generated_text"][-1]) # Expected Output: {'role': 'assistant', 'content': '2 + 2 = 4'}model.generate() APIpip install flash_attn==2.6.31import torch
2from transformers import AutoTokenizer, LlamaForCausalLM
3# Apply Llama3.1 chat-template
4def format_prompt(user_query):
5 template = """<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\nYou are a helpful assistant.<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n{}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n"""
6 return template.format(user_query)
7model_id = 'EpistemeAI2/FireStorm-Llama-3.1-8B'
8tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
9model = LlamaForCausalLM.from_pretrained(
10 model_id,
11 torch_dtype=torch.bfloat16,
12 device_map="auto",
13 load_in_8bit=False,
14 load_in_4bit=False,
15 use_flash_attention_2=True
16)
17# Build final input prompt after applying chat-template
18prompt = format_prompt("What is 2+2?")
19input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to("cuda")
20generated_ids = model.generate(input_ids, max_new_tokens=128, temperature=0.01, do_sample=True, eos_token_id=tokenizer.eos_token_id)
21response = tokenizer.decode(generated_ids[0][input_ids.shape[-1]:], skip_special_tokens=True)
22print(response) # Expected Output: '2 + 2 = 4'1from vllm import LLM, SamplingParams
2from transformers import AutoTokenizer
3model_id = "EpistemeAI2/FireStorm-Llama-3.1-8B" # FP8 model: "EpistemeAI2/FireStorm-Llama-3.1-8B"
4num_gpus = 1
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6llm = LLM(model=model_id, tensor_parallel_size=num_gpus)
7sampling_params = SamplingParams(max_tokens=128, temperature=0.01, top_k=100, top_p=0.95)
8messages = [
9 {"role": "system", "content": "You are a helpful assistant."},
10 {"role": "user", "content": "What is 2+2?"}
11]
12prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize = False)
13print(llm.generate([prompt], sampling_params)[0].outputs[0].text.strip()) # Expected Output: 2 + 2 = 41pip install 'litgpt[all]'
2litgpt download EpistemeAI2/FireStorm-Llama-3.1-8B --model_name meta-llama/Meta-Llama-3.1-8B1from litgpt import LLM
2llm = LLM.load(model="EpistemeAI2/FireStorm-Llama-3.1-8B")
3llm.generate("What do Llamas eat?")You are a function calling AI model. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into function. The user may use the terms function calling or tool use interchangeably.
Here are the available functions:
<tools>LIST_OF_TOOLS</tools>
For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags in the format:
<tool_call>{"tool_name": <function-name>, "tool_arguments": <args-dict>}</tool_call>LIST_OF_TOOLS as input.1import json
2from vllm import LLM, SamplingParams
3from transformers import AutoTokenizer
4model_id = "EpistemeAI2/FireStorm-Llama-3.1-8B" # FP8 model: "akjindal53244/Llama-3.1-Storm-8B-FP8-Dynamic"
5num_gpus = 1
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7llm = LLM(model=model_id, tensor_parallel_size=num_gpus)
8sampling_params = SamplingParams(max_tokens=128, temperature=0.01, top_k=100, top_p=0.95)
9def create_system_prompt(tools_list):
10 system_prompt_format = """You are a function calling AI model. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into function. The user may use the terms function calling or tool use interchangeably.
11Here are the available functions:
12<tools>{}</tools>
13For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags in the format:
14<tool_call>{"tool_name": <function-name>, "tool_arguments": <args-dict>}</tool_call>"""
15
16 # Convert the tools list to a string representation
17 tools_str = json.dumps(tools_list, ensure_ascii=False)
18 # Format the system prompt with the tools list
19 system_prompt = system_prompt_format.format(tools_str)
20 return system_prompt
21# Example tools list
22tools_list = [
23 {
24 "name": "peers",
25 "description": "Retrieves a list of company peers given a stock symbol.",
26 "parameters": {
27 "symbol": {
28 "description": "The stock symbol for the company.",
29 "type": "str",
30 "default": ""
31 }
32 }
33 },
34 {
35 "name": "web_chain_details",
36 "description": "python",
37 "parameters": {
38 "chain_slug": {
39 "description": "The slug identifier for the blockchain (e.g., 'ethereum' for Ethereum mainnet).",
40 "type": "str",
41 "default": "ethereum"
42 }
43 }
44 }
45]
46# Create the system prompt with the tools list
47system_prompt = create_system_prompt(tools_list)
48messages = [
49 {"role": "system", "content": system_prompt},
50 {"role": "user", "content": "I need to understand the details of the Ethereum blockchain for my cryptocurrency project. Can you fetch the details for 'ethereum'?"}
51]
52prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize = False)
53print(llm.generate([prompt], sampling_params)[0].outputs[0].text.strip()) # Expected Output: <tool_call>{'tool_name': 'web_chain_details', 'tool_arguments': {'chain_slug': 'ethereum'}}</tool_call>import ollama
tools = [{
'type': 'function',
'function': {
'name': 'get_current_weather',
'description': 'Get the current weather for a city',
'parameters': {
'type': 'object',
'properties': {
'city': {
'type': 'string',
'description': 'The name of the city',
},
},
'required': ['city'],
},
},
},
{
'type': 'function',
'function': {
'name': 'get_places_to_vist',
'description': 'Get places to visit in a city',
'parameters': {
'type': 'object',
'properties': {
'city': {
'type': 'string',
'description': 'The name of the city',
},
},
'required': ['city'],
},
},
},
]
response = ollama.chat(
model='ajindal/llama3.1-storm:8b',
messages=[
{'role': 'system', 'content': 'Do not answer to nay vulgar questions.'},
{'role': 'user', 'content': 'What is the weather in Toronto and San Francisco?'}
],
tools=tools
)
print(response['message']) # Expected Response: {'role': 'assistant', 'content': "<tool_call>{'tool_name': 'get_current_weather', 'tool_arguments': {'city': 'Toronto'}}</tool_call>"}@misc {ashvini_kumar_jindal_2024,
author = { {Ashvini Kumar Jindal, Pawan Kumar Rajpoot, Ankur Parikh, Akshita Sukhlecha} },
title = { Llama-3.1-Storm-8B },
year = 2024,
url = { https://huggingface.co/akjindal53244/Llama-3.1-Storm-8B },
doi = { 10.57967/hf/2902 },
publisher = { Hugging Face }
}