Skip to main content
This page runs a flow that needs no API key, then adds a model. It uses the published npm packages. To run from a clone instead, see installation.

Prerequisites

  • Node.js 22 or later, with npm or pnpm.

Run a flow

1

Create the config file

In an empty directory, create milford.config.yaml. It lists the flows to load and the token that callers must send.
milford.config.yaml
2

Create a flow

A flow is a graph of nodes. This one takes a name and returns a greeting.
flows/hello.json
3

Start the server

The server loads and checks every flow before it listens, and prints the number of flows it loaded.
4

Run the flow

The response holds the result of every node and the flow output, here "Hello Ann!".

Add a model

A decision node asks a provider a typed question and returns a value your graph can branch on. Add a provider to milford.config.yaml:
Then add a decision node to a flow. A low-confidence answer becomes none_of_these:
Edges with a when condition route on the answer. See decisions and flows. Switching the provider to an OpenAI-compatible server or a local classifier is a config change.

Use the library instead

createEngine and run return results instead of throwing. Check ok before you read value.

Next steps

Flows

How the executor walks a graph.

Providers

OpenAI-compatible, Anthropic, Jev and your own classifier.

MCP

Expose flows as tools to LLM clients.

Deployment

Docker, limits and offline use.