Test Multiple Local LLMs with n8n and LM Studio

Struggling to evaluate multiple local LLM models for readability and response quality? This n8n workflow automates testing across LM Studio models, capturing detailed metrics and saving results for easy comparison, helping you optimize AI deployments efficiently.
httpRequest
lmChatOpenAi
googleSheets
+7
Workflow Identifier: 1952
NODES in Use: stickyNote, httpRequest, chatTrigger, splitOut, dateTime, set, lmChatOpenAi, code, googleSheets, chainLlm

Press CTRL+F5 if the workflow didn't load.

Learn how to Build this Workflow with AI:

Visit through Desktop for Best experience

What this Workflow Does

This workflow tests many local LLMs running on LM Studio with the same chat prompt.
It helps find how clear, readable, and fast each model answers.
You get results logged with key info like response time and readability scores in Google Sheets.
This saves a lot of testing time and gives clear comparison data.


Tools and Services Used

  • LM Studio Server: Hosts local AI language models.
  • n8n Platform: Runs the workflow, manages automation.
  • Google Sheets: Stores test results for review.
  • OpenAI API Credentials: For LangChain node to send prompts.

Inputs, Processing, and Outputs

Inputs

  • User chat message prompt sent via When chat message received node.
  • Currently loaded model IDs fetched from LM Studio via Get Models HTTP Request node.

Processing Steps

  • Split each model ID to query separately.
  • Record time when prompt is sent to each model.
  • Add a system prompt to guide model replies.
  • Send prompt with parameters like temperature to each model using LangChain.
  • Capture response time for each.
  • Calculate text metrics such as word count, sentence length, and readability score via code.
  • Format all data for logging.

Outputs

  • Detailed row data appended to Google Sheets showing prompt, model, timings, and response metrics.
  • Optionally review data inside n8n if Google Sheets node is removed.

Who Should Use This Workflow

This is for AI developers testing different local LLMs on LM Studio.
It suits users who want clear, side-by-side data about how each model answers the same questions.
Beginners and experts can both use results to pick the best model for their needs.


Beginner Step-by-Step: How to Use This Workflow in n8n

Step 1: Import the Workflow

  1. Download the workflow JSON file using the Download button on this page.
  2. Open the n8n editor, then click “Import from File” and select the downloaded file.

Step 2: Configure Credentials and Settings

  1. Add Google Sheets API credentials in n8n for saving test results.
  2. Add OpenAI API Key to the LangChain Run Model with Dunamic Inputs node.
  3. Update the Get Models node’s Base URL with the correct LM Studio IP and port (like http://192.168.1.179:1234).
  4. If needed, update Google Sheets table ID or sheet name inside the Google Sheets node.
  5. Verify that system prompt text in the Add System Prompt node fits your goals (optional).

Step 3: Test and Activate

  1. Run the workflow once manually by sending a chat prompt trigger.
  2. Check that results appear in Google Sheets or inside n8n output.
  3. Fix any errors like permission issues or wrong URLs.
  4. Once tested, activate the workflow to run automatically on new chat messages.

Note: Use self-host n8n to run this automation privately if needed.


Customization Ideas

  • Change temperature and topP in LangChain node to see how model creativity shifts.
  • Edit system prompt to change model response style or reading difficulty.
  • Add text sentiment or keyword analysis in the JavaScript code node.
  • Replace Google Sheets logging with a database node or CSV export for preferred storage.
  • Modify Base URL in Get Models to test models hosted elsewhere.

Common Issues and Solutions

  • Timeout fetching models: Check LM Studio IP and port. Server might be offline.
  • No or empty model response: Verify model IDs from extracted list. Test models manually in LM Studio.
  • Google Sheets permissions error: Refresh OAuth tokens and confirm access rights.

Inputs and Outputs Summary

  • Input: Chat message prompt, LM Studio model list.
  • Output: Response texts, metrics, timings logged to Google Sheets.

This helps users see which local LLM answers best and fastest for their needs.


Results and Benefits

✓ Save hours of copying and testing models one-by-one.
✓ Get clear data like speed, readability, and length of each answer.
✓ See all results in one Google Sheet for easy comparison.
✓ Make better model choices with objective info.
✓ Quickly adapt prompts and see how different models react.


Frequently Asked Questions

The workflow uses the Get Models HTTP Request node to call LM Studio’s API and retrieve all currently loaded model IDs dynamically.
It calculates word count, sentence count, average sentence length and word length, plus the Flesch-Kincaid readability score using JavaScript code.
The workflow appends each model’s test data into a Google Sheets spreadsheet using the Save Results to Google Sheets node.
Check that the Base URL in the Get Models node matches the actual LM Studio server IP and port, and ensure the LM Studio server is running and accessible.

Promoted by BULDRR AI

Related Workflows

Automate Viral UGC Video Creation Using n8n + Degaus (Beginner-Friendly Guide)

Learn how to automate viral UGC video creation using n8n, AI prompts, and Degaus. This beginner-friendly guide shows how to import, configure, and run the workflow without technical complexity.
Form Trigger
Google Sheets
Gmail
+37
Free

AI SEO Blog Writer Automation Workflows in n8n

A complete beginner guide to building an AI SEO blog writer automation using n8n.
AI Agent
Google Sheets
httpRequest
+5
Free

Automate CrowdStrike Alerts with VirusTotal, Jira & Slack

This workflow automates processing of CrowdStrike detections by enriching threat data via VirusTotal, creating Jira tickets for incident tracking, and notifying teams on Slack for quick response. Save hours daily by transforming complex threat data into actionable alerts effortlessly.
scheduleTrigger
httpRequest
jira
+5
Free

Automate Telegram Invoices to Notion with AI Summaries & Reports

Save hours on financial tracking by automating invoice extraction from Telegram photos to Notion using Google Gemini AI. This workflow extracts data, records transactions, and generates detailed spending reports with charts sent on schedule via Telegram.
lmChatGoogleGemini
telegramTrigger
notion
+9
Free

Automate Email Replies with n8n and AI-Powered Summarization

Save hours managing your inbox with this n8n workflow that uses IMAP email triggers, AI summarization, and vector search to draft concise replies requiring minimal review. Automate business email processing efficiently with AI guidance and Gmail integration.
emailReadImap
vectorStoreQdrant
emailSend
+12
Free

Automate Email Campaigns Using n8n with Gmail & Google Sheets

This n8n workflow automates personalized email outreach campaigns by integrating Gmail and Google Sheets, saving hours of manual follow-up work and reducing errors in email sequences. It ensures timely follow-ups based on previous email interactions, optimizing communication efficiency.
googleSheets
gmail
code
+5
Free