Skip to content

LLM demo pipeline

Run: npm run run:llm
File: examples/pipeline-llm-demo.json

Minimal text → genText chain. Uses GraphEngine({ llm }) and the package builtin executor.

Data flow

Nodenode.typeRole
prompt_1textUser topic string
llm_1genTextCalls Bedrock or OpenAI via llm config

Run

bash
cp .env.template .env          # OpenAI-compatible
# or: cp .env.bedrock.template .env.bedrock

npm run run:llm

Uses examples/run-with-llm.mjsresolveLlmFromEnv()GraphEngine({ llm }).

Payload

json
{
  "nodes": [
    {
      "id": "prompt_1",
      "type": "text",
      "data": {
        "label": "Topic",
        "nodeData": "Explain what a DAG is in one short paragraph."
      }
    },
    {
      "id": "llm_1",
      "type": "genText",
      "data": {
        "label": "LLM",
        "isPassThrough": true,
        "nodeData": "Answer using the topic below."
      }
    }
  ],
  "edges": [
    { "id": "e-prompt-llm", "source": "prompt_1", "target": "llm_1" }
  ]
}

LLM configuration · BYO LLM · Examples index

MIT Licensed