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:8bpip install --upgrade "transformers>=4.43.2" torch==2.3.1 accelerate vllm==0.5.3.post11from vllm import LLM, SamplingParams
2from transformers import AutoTokenizer
3
4model_id = "akjindal53244/Llama-3.1-Storm-8B" # FP8 model: "akjindal53244/Llama-3.1-Storm-8B-FP8-Dynamic"
5num_gpus = 1
6
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8llm = LLM(model=model_id, tensor_parallel_size=num_gpus)
9sampling_params = SamplingParams(max_tokens=128, temperature=0.01, top_k=100, top_p=0.95)
10
11messages = [
12 {"role": "system", "content": "You are a helpful assistant."},
13 {"role": "user", "content": "What is 2+2?"}
14]
15prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize = False)
16print(llm.generate([prompt], sampling_params)[0].outputs[0].text.strip()) # Expected Output: 2 + 2 = 4You 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
4
5model_id = "akjindal53244/Llama-3.1-Storm-8B-FP8-Dynamic"
6num_gpus = 1
7
8tokenizer = AutoTokenizer.from_pretrained(model_id)
9llm = LLM(model=model_id, tensor_parallel_size=num_gpus)
10sampling_params = SamplingParams(max_tokens=128, temperature=0.01, top_k=100, top_p=0.95)
11
12
13def create_system_prompt(tools_list):
14 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.
15
16Here are the available functions:
17<tools>{}</tools>
18
19For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags in the format:
20<tool_call>{"tool_name": <function-name>, "tool_arguments": <args-dict>}</tool_call>"""
21
22 # Convert the tools list to a string representation
23 tools_str = json.dumps(tools_list, ensure_ascii=False)
24 # Format the system prompt with the tools list
25 system_prompt = system_prompt_format.format(tools_str)
26 return system_prompt
27
28
29# Example tools list
30tools_list = [
31 {
32 "name": "peers",
33 "description": "Retrieves a list of company peers given a stock symbol.",
34 "parameters": {
35 "symbol": {
36 "description": "The stock symbol for the company.",
37 "type": "str",
38 "default": ""
39 }
40 }
41 },
42 {
43 "name": "web_chain_details",
44 "description": "python",
45 "parameters": {
46 "chain_slug": {
47 "description": "The slug identifier for the blockchain (e.g., 'ethereum' for Ethereum mainnet).",
48 "type": "str",
49 "default": "ethereum"
50 }
51 }
52 }
53]
54
55# Create the system prompt with the tools list
56system_prompt = create_system_prompt(tools_list)
57
58messages = [
59 {"role": "system", "content": system_prompt},
60 {"role": "user", "content": "I need to understand the details of the Ethereum blockchain for my cryptocurrency project. Can you fetch the details for 'ethereum'?"}
61]
62
63prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize = False)
64print(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 }
}