Monetize your private LLM models with x402 & Ollama
UnknownWhat this workflow does
This AI workflow has 12 nodes and runs when an HTTP POST request hits its webhook URL. Along the way it connects Ollama Model and 1shot (community).
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Check for presence of X-HEADER (If): checks a condition and branches into true / false
- Decode & Validate X-Payment (Code): runs custom JavaScript code
- Response: Missing or Invalid Payment Headers (Respond to Webhook): sends the response back to the webhook caller
- Ensure Well Formatted Payment Payload (If): checks a condition and branches into true / false
- Simulate Payment (One Shot): simulate
- On Successful Payment Simulation (If): checks a condition and branches into true / false
- 1Shot API Submit & Wait (One Shot Synch): uses One Shot Synch
- Response: Payment Invalid (Respond to Webhook): sends the response back to the webhook caller
- Private Model Inference (Basic LLM Chain): sends a prompt to an LLM, with model: Ollama Engine
- Response: 200 - Payment Successful (Respond to Webhook): sends the response back to the webhook caller
Services it uses
Before you upgrade to n8n 3.0
We can't fully verify this one: it relies on 2 community packages, and n8n 3.0 turns unverified community packages off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).
- Check that n8n-nodes-1shot is verified or supports 3.0 (used in Simulate Payment).
- Check that n8n-nodes-1shot is verified or supports 3.0 (used in 1Shot API Submit & Wait).
Nodes used (8)
- Webhook
n8n-nodes-base.webhook - If
n8n-nodes-base.if - Code
n8n-nodes-base.code - One Shot
n8n-nodes-1shot.oneShot - One Shot Synch
n8n-nodes-1shot.oneShotSynch - Respond to Webhook
n8n-nodes-base.respondToWebhook - Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm - Ollama Model
@n8n/n8n-nodes-langchain.lmOllama
From the author
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Monetize Your Private LLM Models with x402 and Ollama Self-hosting custom LLMs is becoming more popular and easier with turn-key inferencing tools like…