lfm3-studio / workflow.json
akhaliq's picture
akhaliq HF Staff
add workflow canvas graph
7910e77 verified
Raw History Blame Contribute Delete
7.13 kB
{
"schema_version": "2",
"name": "LFM3-1.7B — chat & extract",
"references": [
{
"id": "ref_prompt",
"label": "Prompt",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 40,
"y": 40,
"width": 320,
"height": 140,
"data": {"out": "Explain how a heat pump works, in three sentences."}
},
{
"id": "ref_system",
"label": "System Prompt",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 40,
"y": 210,
"width": 320,
"height": 110,
"data": {"out": "You are a helpful assistant trained by Liquid AI."}
},
{
"id": "ref_preset",
"label": "Preset (general | math)",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 40,
"y": 350,
"width": 170,
"height": 90,
"data": {"out": "general"}
},
{
"id": "ref_max_tokens",
"label": "Max New Tokens",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 230,
"y": 350,
"width": 130,
"height": 90,
"data": {"out": "1024"}
},
{
"id": "ref_thinking",
"label": "Thinking (true | false)",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 40,
"y": 470,
"width": 170,
"height": 90,
"data": {"out": "true"}
},
{
"id": "ref_seed",
"label": "Seed (0 = random)",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 230,
"y": 470,
"width": 130,
"height": 90,
"data": {"out": "0"}
},
{
"id": "ref_messy",
"label": "Messy Text",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 40,
"y": 610,
"width": 320,
"height": 140,
"data": {"out": "Invoice 4521 — ACME Corp, billed 2026-10-11, amount due $1,299.50. Payment terms net 30. Contact: j.rivera@acme.example"}
},
{
"id": "ref_fields",
"label": "Fields to Extract",
"role": "reference",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 40,
"y": 780,
"width": 320,
"height": 90,
"data": {"out": "invoice_number, company, billed_date, amount_due_usd, contact_email"}
}
],
"operators": [
{
"id": "op_chat",
"label": "LFM3 Chat",
"role": "operator",
"kind": "fn",
"fn": "lfm3_chat",
"inputs": [
{"id": "prompt", "label": "Prompt", "type": "text", "required": true},
{"id": "system_prompt", "label": "System", "type": "text"},
{"id": "preset", "label": "Preset", "type": "text"},
{"id": "max_new_tokens", "label": "Max Tokens", "type": "text"},
{"id": "enable_thinking", "label": "Thinking", "type": "text"},
{"id": "seed", "label": "Seed", "type": "text"}
],
"outputs": [{"id": "out_0", "label": "Reply", "type": "text", "output_index": 0}],
"x": 480,
"y": 120,
"width": 230,
"height": 190,
"data": {}
},
{
"id": "op_extract",
"label": "LFM3 Extract JSON",
"role": "operator",
"kind": "fn",
"fn": "lfm3_extract",
"inputs": [
{"id": "text", "label": "Text", "type": "text", "required": true},
{"id": "fields", "label": "Fields", "type": "text", "required": true},
{"id": "max_new_tokens", "label": "Max Tokens", "type": "text"},
{"id": "seed", "label": "Seed", "type": "text"}
],
"outputs": [{"id": "out_0", "label": "JSON", "type": "text", "output_index": 0}],
"x": 480,
"y": 640,
"width": 230,
"height": 160,
"data": {}
}
],
"subjects": [
{
"id": "sub_reply",
"label": "Reply",
"role": "subject",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 780,
"y": 150,
"width": 260,
"height": 110,
"data": {}
},
{
"id": "sub_json",
"label": "Extracted JSON",
"role": "subject",
"asset_type": "text",
"inputs": [{"id": "in", "label": "Text", "type": "text"}],
"outputs": [{"id": "out", "label": "Text", "type": "text"}],
"x": 780,
"y": 670,
"width": 260,
"height": 110,
"data": {}
}
],
"edges": [
{"id": "e_prompt", "from_node_id": "ref_prompt", "from_port_id": "out", "to_node_id": "op_chat", "to_port_id": "prompt", "type": "text"},
{"id": "e_system", "from_node_id": "ref_system", "from_port_id": "out", "to_node_id": "op_chat", "to_port_id": "system_prompt", "type": "text"},
{"id": "e_preset", "from_node_id": "ref_preset", "from_port_id": "out", "to_node_id": "op_chat", "to_port_id": "preset", "type": "text"},
{"id": "e_maxtok", "from_node_id": "ref_max_tokens", "from_port_id": "out", "to_node_id": "op_chat", "to_port_id": "max_new_tokens", "type": "text"},
{"id": "e_thinking", "from_node_id": "ref_thinking", "from_port_id": "out", "to_node_id": "op_chat", "to_port_id": "enable_thinking", "type": "text"},
{"id": "e_seed", "from_node_id": "ref_seed", "from_port_id": "out", "to_node_id": "op_chat", "to_port_id": "seed", "type": "text"},
{"id": "e_reply", "from_node_id": "op_chat", "from_port_id": "out_0", "to_node_id": "sub_reply", "to_port_id": "in", "type": "text"},
{"id": "e_messy", "from_node_id": "ref_messy", "from_port_id": "out", "to_node_id": "op_extract", "to_port_id": "text", "type": "text"},
{"id": "e_fields", "from_node_id": "ref_fields", "from_port_id": "out", "to_node_id": "op_extract", "to_port_id": "fields", "type": "text"},
{"id": "e_maxtok2", "from_node_id": "ref_max_tokens", "from_port_id": "out", "to_node_id": "op_extract", "to_port_id": "max_new_tokens", "type": "text"},
{"id": "e_seed2", "from_node_id": "ref_seed", "from_port_id": "out", "to_node_id": "op_extract", "to_port_id": "seed", "type": "text"},
{"id": "e_json", "from_node_id": "op_extract", "from_port_id": "out_0", "to_node_id": "sub_json", "to_port_id": "in", "type": "text"}
]
}