Using Chinda LLM 4B with n8n - Complete Workflow Automation Guide
🎯 Introduction
Chinda LLM 4B is an open-source Thai language model developed by the iApp Technology team, capable of thinking and responding in Thai with high accuracy using the latest Qwen3-4B architecture.
n8n is a powerful workflow automation tool that allows you to connect different services and automate tasks without coding. By integrating Chinda LLM 4B with n8n, you can create sophisticated AI-powered workflows that process Thai language data automatically.
🚀 Step 1: Installing n8n
Method 1: Using npm (Recommended for Development)
Install Node.js (if not already installed)
Download and install Node.js from https://nodejs.org/
Install n8n globally:
npm install n8n -g
Start n8n:
n8n start
Method 2: Using Docker (Recommended for Production)
Pull and run n8n Docker container:
docker run -it --rm \
--name n8n \
-p 5678:5678 \
-v ~/.n8n:/home/node/.n8n \
n8nio/n8n
Method 3: Using npx (No Installation Required)
npx n8n
Verify Installation
After starting n8n, open your browser and go to:
http://localhost:5678
You should see the n8n interface with a welcome screen.
🔍 Step 2: Setting Up Chinda LLM 4B
Option A: Using Ollama Backend (Recommended)
Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh
Download Chinda LLM 4B:
ollama pull iapp/chinda-qwen3-4b
Start Ollama API server:
ollama serve
The API will be available at http://localhost:11434
Option B: Using Direct API Endpoint
- Open ChindaX platform in your browser (https://chindax.iapp.co.th)
- Register / Login into the ChindaX website.
- Go to Integrations menu at the left.
- Click at Setting button at the top right of API integration.
- Copy URL and Bearer Token from the code block.
⚙️ Step 3: Creating Your First Workflow
Basic Workflow Setup
- Open n8n in your browser (
http://localhost:5678
) - Click "New Workflow" to create a new automation
- Add nodes to create your AI workflow
Example 1: Simple Text Processing Workflow
Step 1: Add Manual Trigger
- Click the "+" button to add a node
- Search for "Manual Trigger" and select it
- Click "Execute Node" to test
Step 2: Add HTTP Request Node
- Add another node and search for "HTTP Request"
- Configure the HTTP Request node:
- Method: POST
- URL:
http://localhost:11434/api/generate
orhttps://chindax.iapp.co.th/api/chat/completions
(from ChindaX) - Headers: If you get API from ChindaX, don't forgot to add "Authorization" key.
{
"Content-Type": "application/json",
"Authorization": "Bearer sk-********************",
} - Body: (for Ollama)
{
"model": "iapp/chinda-qwen3-4b",
"prompt": "สวัสดีครับ ช่วยอธิบายเกี่ยวกับปัญญาประดิษฐ์ให้ฟังหน่อย",
"stream": false
} - Body: (for ChindaX)
{
"model": "chinda-qwen3-4b",
"messages": [
{
"role": "user",
"content": "สวัสดีครับ! ช่วยเขียนจดหมายให้ผมหน่อย"
}
]
}
Step 3: Add Set Node (Optional)
- Add a "Set" node to format the response
- Configure to extract the AI response:
- Keep Only Set: Enable
- Values to Set:
- Name:
ai_response
- Value:
{{ $json.response }}
- Name:
Example 2: Email Processing Workflow
This workflow automatically processes Thai emails and generates responses.
Workflow Structure:
Email Trigger → Extract Email Content → Chinda LLM Processing → Send Response
Step 1: Add Email Trigger
- Add "Email Trigger (IMAP)" node
- Configure your email settings:
- Host: Your email provider's IMAP server
- Port: Usually 993 for SSL
- Username: Your email address
- Password: Your email password
- SSL/TLS: Enable
Step 2: Process with Chinda LLM
- Add "HTTP Request" node
- Configure for Chinda LLM:
{
"model": "iapp/chinda-qwen3-4b",
"prompt": "ช่วยตอบอีเมลนี้อย่างสุภาพและเป็นมิตร: {{ $json.text }}",
"stream": false
}
Step 3: Send Response Email
- Add "Send Email" node
- Configure response settings:
- To:
{{ $json.from.value[0].address }}
- Subject:
Re: {{ $json.subject }}
- Text:
{{ $json.response }}
- To:
🌐 Step 4: Advanced Workflows
Workflow 1: Document Translation Service
Components:
- Webhook Trigger: Receive documents via HTTP
- Extract Text: Process different file formats
- Chinda LLM: Translate Thai ↔ English
- Return Response: Send translated content
Setup:
-
Add Webhook node:
- Set webhook path:
/translate
- Method: POST
- Set webhook path:
-
Add Switch node (for file type detection):
- Condition 1: PDF files
- Condition 2: Text files
- Condition 3: Word documents
-
Add HTTP Request for Chinda LLM:
{
"model": "iapp/chinda-qwen3-4b",
"prompt": "กรุณาแปลข้อความนี้จากภาษาไทยเป็นภาษาอังกฤษ: {{ $json.text }}",
"stream": false
}
Workflow 2: Customer Support Chatbot
Components:
- Chat Trigger: Connect to messaging platforms
- Context Management: Maintain conversation history
- Chinda LLM: Generate responses
- Response Formatting: Format for different platforms
Setup:
-
Add Telegram Trigger (or your preferred platform)
-
Add Function node for context management:
// Store conversation context
const userId = $input.first().json.message.from.id;
const message = $input.first().json.message.text;
// Retrieve previous context (implement your storage logic)
const context = await getContext(userId);
return {
userId,
message,
context: context || [],
fullPrompt: `บริบทการสนทนา: ${context.join('\n')}\nคำถามใหม่: ${message}\nตอบ:`
}; -
Add Chinda LLM processing
-
Add response node back to the chat platform
Workflow 3: Content Generation Pipeline
For Blog Posts and Articles:
- Schedule Trigger: Run daily/weekly
- RSS Feed Reader: Get topic ideas
- Chinda LLM: Generate Thai content
- Content Formatting: Add HTML/Markdown
- CMS Publishing: Auto-publish to WordPress/Ghost
💬 Step 5: Using Chinda LLM Node (Custom Integration)
Creating a Custom Chinda LLM Node
If you frequently use Chinda LLM, create a reusable custom node:
Step 1: Create Node Template
{
"name": "Chinda LLM",
"icon": "🤖",
"group": ["AI"],
"description": "Process text with Chinda LLM 4B",
"properties": [
{
"displayName": "Prompt",
"name": "prompt",
"type": "string",
"required": true,
"default": "",
"description": "Text prompt in Thai"
},
{
"displayName": "Temperature",
"name": "temperature",
"type": "number",
"default": 0.7,
"description": "Controls randomness (0-1)"
}
]
}
Using Code Node for Advanced Processing
Add a "Code" node for complex Thai text processing:
// Process Thai text with Chinda LLM
const axios = require('axios');
const prompt = $input.first().json.text;
const response = await axios.post('http://localhost:11434/api/generate', {
model: 'iapp/chinda-qwen3-4b',
prompt: `ประมวลผลข้อความนี้: ${prompt}`,
stream: false,
options: {
temperature: 0.7,
top_p: 0.9
}
});
return {
original: prompt,
processed: response.data.response,
timestamp: new Date().toISOString()
};
🔧 Troubleshooting
Common Issues and Solutions
Issue: Connection Refused to Ollama
Error: connect ECONNREFUSED 127.0.0.1:11434
Solution: Make sure Ollama is running:
ollama serve
Issue: n8n Workflow Timeout
Solution: Increase timeout in HTTP Request node:
- Set Timeout: 30000 (30 seconds)
- For longer responses, increase further
Issue: Memory Issues with Large Prompts
Solution:
- Break large texts into smaller chunks
- Use pagination in workflows
- Implement text summarization first