{"_id":"686fab94475469075ea83464","id":"LiquidAI/LFM2-350M","private":false,"pipeline_tag":"text-generation","library_name":"transformers","tags":["transformers","safetensors","lfm2","text-generation","liquid","edge","conversational","en","ar","zh","fr","de","ja","ko","es","arxiv:2511.23404","license:other","endpoints_compatible","deploy:azure","region:us"],"downloads":11657,"likes":256,"modelId":"LiquidAI/LFM2-350M","author":"LiquidAI","sha":"f37d3f5c8c5484bc01dad379a595cf4c68c4e70e","lastModified":"2026-08-05T16:56:51.000Z","gated":false,"disabled":false,"widgetData":[{"text":"Hi, what can you help me with?"},{"text":"What is 84 * 3 / 2?"},{"text":"Tell me an interesting fact about the universe!"},{"text":"Explain quantum computing in simple terms."}],"model-index":null,"config":{"architectures":["Lfm2ForCausalLM"],"model_type":"lfm2","tokenizer_config":{"bos_token":"<|startoftext|>","eos_token":"<|im_end|>","pad_token":"<|pad|>","use_default_system_prompt":false},"chat_template_jinja":"{{- bos_token -}}\n{%- macro format_arg_value(arg_value) -%}\n\t{%- if arg_value is string -%}\n\t\t{{- \"'\" + (arg_value | replace(\"\\\\\", \"\\\\\\\\\") | replace(\"'\", \"\\\\'\") | replace(\"\\n\", \"\\\\n\") | replace(\"\\r\", \"\\\\r\")) + \"'\" -}}\n\t{%- elif arg_value is mapping or arg_value is iterable -%}\n\t\t{{- arg_value | tojson -}}\n\t{%- else -%}\n\t\t{{- arg_value | string -}}\n\t{%- endif -%}\n{%- endmacro -%}\n{%- macro render_tool_calls(tool_calls) -%}\n\t{%- set tool_calls_ns = namespace(tool_calls=[]) -%}\n\t{%- for tool_call in tool_calls -%}\n\t\t{%- set func = tool_call[\"function\"] if \"function\" in tool_call else tool_call -%}\n\t\t{%- set func_name = func[\"name\"] -%}\n\t\t{%- set func_args = func.get(\"arguments\") -%}\n\t\t{%- set args_ns = namespace(arg_strings=[]) -%}\n\t\t{%- if func_args is mapping -%}\n\t\t\t{%- for arg_name, arg_value in func_args.items() -%}\n\t\t\t\t{%- set args_ns.arg_strings = args_ns.arg_strings + [arg_name + \"=\" + format_arg_value(arg_value)] -%}\n\t\t\t{%- endfor -%}\n\t\t{%- elif func_args is string and (func_args | trim) not in [\"\", \"{}\", \"null\"] -%}\n\t\t\t{{- raise_exception(\"Tool call arguments must be a mapping, got a JSON-encoded string: parse arguments with json.loads() before applying the chat template\") -}}\n\t\t{%- endif -%}\n\t\t{%- set tool_calls_ns.tool_calls = tool_calls_ns.tool_calls + [func_name + \"(\" + (args_ns.arg_strings | join(\", \")) + \")\"] -%}\n\t{%- endfor -%}\n\t{{- \"<|tool_call_start|>[\" + (tool_calls_ns.tool_calls | join(\", \")) + \"]<|tool_call_end|>\" -}}\n{%- endmacro -%}\n{%- set system_prompt = \"\" -%}\n{%- set ns = namespace(system_prompt=\"\") -%}\n{%- if messages[0][\"role\"] == \"system\" -%}\n\t{%- set ns.system_prompt = messages[0][\"content\"] -%}\n\t{%- set messages = messages[1:] -%}\n{%- endif -%}\n{%- if tools -%}\n\t{%- set ns.system_prompt = ns.system_prompt + (\"\\n\" if ns.system_prompt else \"\") + \"List of tools: <|tool_list_start|>[\" -%}\n\t{%- for tool in tools -%}\n\t\t{%- if tool is not string -%}\n            {%- set tool = tool | tojson -%}\n\t\t{%- endif -%}\n\t\t{%- set ns.system_prompt = ns.system_prompt + tool -%}\n        {%- if not loop.last -%}\n            {%- set ns.system_prompt = ns.system_prompt + \", \" -%}\n        {%- endif -%}\n\t{%- endfor -%}\n\t{%- set ns.system_prompt = ns.system_prompt + \"]<|tool_list_end|>\" -%}\n{%- endif -%}\n{%- if ns.system_prompt -%}\n\t{{- \"<|im_start|>system\\n\" + ns.system_prompt + \"<|im_end|>\\n\" -}}\n{%- endif -%}\n{%- for message in messages -%}\n\t{{- \"<|im_start|>\" + message[\"role\"] + \"\\n\" -}}\n\t{%- set content = message.get(\"content\") -%}\n\t{%- if content is not string -%}\n\t\t{%- set content = content | tojson -%}\n\t{%- endif -%}\n\t{%- if message[\"role\"] == \"tool\" -%}\n\t\t{%- set content = \"<|tool_response_start|>\" + content + \"<|tool_response_end|>\" -%}\n\t{%- endif -%}\n\t{%- if message[\"role\"] == \"assistant\" and message.get(\"tool_calls\") -%}\n\t\t{%- if content and content != \"null\" -%}\n\t\t\t{{- content -}}\n\t\t{%- endif -%}\n\t\t{{- render_tool_calls(message[\"tool_calls\"]) -}}\n\t\t{{- \"<|im_end|>\\n\" -}}\n\t{%- else -%}\n\t\t{{- content + \"<|im_end|>\\n\" -}}\n\t{%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n\t{{- \"<|im_start|>assistant\\n\" -}}\n{%- endif -%}"},"cardData":{"library_name":"transformers","license":"other","license_name":"lfm1.0","license_link":"LICENSE","language":["en","ar","zh","fr","de","ja","ko","es"],"pipeline_tag":"text-generation","tags":["liquid","lfm2","edge"],"new_version":"LiquidAI/LFM2.5-350M"},"transformersInfo":{"auto_model":"AutoModelForCausalLM","pipeline_tag":"text-generation","processor":"AutoTokenizer"},"siblings":[{"rfilename":".gitattributes"},{"rfilename":"LICENSE"},{"rfilename":"README.md"},{"rfilename":"chat_template.jinja"},{"rfilename":"config.json"},{"rfilename":"generation_config.json"},{"rfilename":"model.safetensors"},{"rfilename":"special_tokens_map.json"},{"rfilename":"tokenizer.json"},{"rfilename":"tokenizer_config.json"}],"spaces":["EuroEval/euroeval_leaderboard","UniversalComputingResearch/clmi","FlameF0X/lfm2","faizhalas/coconut","Vyvo/VyvoTTS-V2-Tokenizer","Mihaiii/llm_steer","FlameF0X/SLM-Playground","haotle/LibTesting","enacimie/SimpleChatGradio-LFM2","Alovestocode/router-router-zero","ncc01/ZeroGPU-LLM-Inference","helenai/check-optimum-intel-support","CatoG/BiasTest","CatoG/DPO_Demo","Mihaiii/repeng-demo","polats/ZeroGPU-LLM-Inference","afrenkai/test","Dashiell47/CS553_Case_Study_1","Dashiell47/CS553_Case_Study_1_copy","HedronCreeper/lfm2","gg34455/acoustic-backend","cdotsanghvi/lfm-claims-encoder","3bitquantizers/station-vision-tts","sonic-coder/CPU-LLM-Inference"],"createdAt":"2025-07-10T12:01:24.000Z","safetensors":{"parameters":{"BF16":354483968},"total":354483968},"usedStorage":708984464}