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
Test Local LLMs with n8n and LM Studio

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

Learn how to Build this Workflow with AI:

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.


Test Local LLMs with n8n and LM Studio

Visit through Desktop to Interact with the Workflow.

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 Twist Channel Creation and Messaging with n8n

This workflow automates creating and updating a channel in Twist and sending a personalized message to specific users. It eliminates manual setup errors and saves time managing Twist communications.

Automate Ideogram Image Generation with Google Sheets & Gmail

This workflow automates graphic design image generation via Ideogram AI, storing image data in Google Sheets and Google Drive, with email alerts via Gmail. It saves designers hours by automating image creation, remixing, review, and record-keeping.

Automate IT Support with Slack and OpenAI in n8n

Streamline IT support by automating Slack message handling using n8n and OpenAI. This workflow handles Slack DMs, filters bots, queries a Confluence knowledge base, and delivers AI-generated responses, improving support efficiency and response time.

Automate Crypto Analysis with CoinMarketCap & n8n AI Agent

Discover how this unique n8n workflow leverages CoinMarketCap’s multi-agent AI to deliver precise, real-time cryptocurrency insights directly via Telegram. Manage crypto data analysis efficiently with automated multi-source API integration.

Automate Gumroad to Beehiiv Subscriber Sync with n8n

Learn how to automatically add new Gumroad sales customers as Beehiiv newsletter subscribers using n8n automation. This workflow saves time by syncing sales data to Google Sheets CRM and notifying your Telegram channel instantly.

Generate On-Brand Blog Articles Using n8n and OpenAI

This workflow automates the creation of on-brand blog articles by analyzing existing company content using n8n and OpenAI. It extracts article structures and brand voice to produce consistent draft articles, saving significant content creation time.
1:1 Free Strategy Session
Your competitors are already automating. Are you still paying for it manually?

Do you want to adopt AI Automation?

Every hour your team does repetitive work, you're burning real money.
While you wait, faster businesses are cutting costs and moving quicker.
AI and automations aren't the future anymore — they're the present.

Book a live 1-on-1 session where we show you exactly which of your daily tasks can be automated — and what it’s costing you not to.