guides

Local LLM in ByteChef: Qwen3 on Ollama Sorts Tickets in Under a Second

Local LLM in ByteChef: Qwen3 on Ollama Sorts Tickets in Under a Second
11 min read
Ivica Čardić

TL;DR: We pulled Qwen3 8B into Ollama, pointed a ByteChef Ollama connection at http://localhost:11434, and built two workflows: a support-ticket classifier that returns JSON in a fixed shape, and an AI agent that calls a tool before it answers. On an M3 Max the classifier answers in under a second once the model is loaded (about 9 s for the very first call), and the agent finishes its tool call and answer in 2.1 to 2.6 s. Every request went to localhost. The classifier is a ready-made template you can import.

A lot of useful automation never gets built, and the reason is usually one sentence: "we can't send that data to a hosted model." Contracts, patient records, financial data, source code, anything covered by GDPR or a customer's data agreement. Once a workflow sends it to a hosted API, it has left your control.

A local model removes that objection. It runs on hardware you own, the data stays on your network, and there's no per-token bill.

I wanted to know how well that works in practice, not in theory, so everything below comes from one live run: every screenshot and every number.

Why run a local LLM for workflow automation

Four reasons, roughly in the order they end up deciding things:

  • Privacy and compliance. The data stays inside your infrastructure. That's a stronger answer to a data-residency or GDPR question than any vendor's processing agreement.
  • Cost at volume. Our test ticket used 92 prompt tokens and 44 output tokens. Real tickets are longer, so call it 300 tokens each: 100,000 tickets a month is about 30 million tokens on a hosted bill. Locally, it's a machine you already paid for.
  • No outside dependency. There are no rate limits, no provider outages, and nobody retires your model. Once the model is downloaded, it runs without an internet connection.
  • Control. You pick the exact model and version, and it only changes when you change it.

How ByteChef talks to a local Ollama server

ByteChef talks to Ollama over HTTP on the same machine. The triage workflow sends one request per ticket. The agent sends two: one where the model asks for a tool, and one where it writes the answer after ByteChef has run that tool.

Diagram: ByteChef and Ollama on the same machine. The triage workflow sends one request with the ticket and schema and gets JSON back in about 0.9 s. The AI agent makes two calls to Ollama with a Date Helper tool call in between, 2.1 to 2.6 s in total.

The setup we tested on

MachineApple M3 Max, 64 GB unified memory
RuntimeOllama 0.40.9
ByteChef0.36 or later (see Thinking)
Modelqwen3:8b (Q4_K_M), a 5.2 GB download
Memory while loadedabout 10 to 11 GB, 100% on the GPU, 40,960-token context
Generation speed51 to 53 tokens per second

Why Ollama and Qwen3 8B

Ollama isn't the only way to run a model locally. LM Studio does the same job as a desktop app, llama.cpp ships its own server, and vLLM is built for GPU servers that handle many users at once. We used Ollama for two reasons: it installs with one command and downloads models by name, and ByteChef has a dedicated Ollama component. That component gives you a connection, a model dropdown that reads what you've installed, and settings for Ollama-specific options like Thinking and Keep alive.

For the model, we wanted something that fits on a laptop, calls tools reliably (the agent needs that), and sticks to a JSON schema. Qwen3 8B does all three. We checked that ByteChef's Thinking setting doesn't break llama3.2:1b or gpt-oss, but we didn't time them. If you have less memory, qwen3:4b is the next size down. We didn't test it for this post.

Step 1: Pull the model

Install Ollama, then:

ollama pull qwen3:8b
ollama run qwen3:8b "Say hello in five words."

The download took 157 seconds on our connection. After that, nothing in this walkthrough needs the internet.

Or start ByteChef and Ollama together with Docker Compose

If you'd rather run everything in containers on Linux, ByteChef ships a Compose file that starts PostgreSQL, ByteChef and Ollama, and downloads qwen3:8b and the nomic-embed-text embedding model on the first start:

curl -O https://raw.githubusercontent.com/bytechefhq/bytechef/master/docker-compose.ollama.yml
docker compose -f docker-compose.ollama.yml up

Inside that stack, Ollama is at http://ollama:11434, not localhost. The Local Docker docs cover other models and NVIDIA GPUs.

On a Mac, don't run Ollama in Docker. Docker on macOS can't give containers the Apple GPU, so Ollama falls back to the CPU. Even the tiny qwen3:0.6b took 38 seconds to answer one chat message that way. Install Ollama natively, run ByteChef with the plain docker-compose.yml, and point the connection at http://host.docker.internal:11434.

Step 2: Create an Ollama connection

In ByteChef, open Connections → New Connection and pick Ollama.

The Create Connection dialog for Ollama, with URL set to http://localhost:11434 and an empty Token field
  • URL: http://localhost:11434 when Ollama and ByteChef run on the same machine. If ByteChef runs in Docker and Ollama runs on the host, use http://host.docker.internal:11434. With the Compose file above, use http://ollama:11434. For a shared GPU server, use its address.
  • Token: leave it empty for a local Ollama. If you put Ollama behind a reverse proxy that checks a bearer token, enter it here, and ByteChef sends it with every request.

Step 3: Build the triage workflow

The workflow takes a ticket and asks Qwen3 for three things: a category, a priority, and a one-sentence summary.

  1. Create a workflow with a Manual trigger, and add an input named ticket under Workflow Inputs.
  2. Add Ollama → Ask and pick your Ollama connection.
  3. Open the Model dropdown. It lists the models installed on your Ollama server, so qwen3:8b is right there.
The Model dropdown of the Ollama Ask action listing the models installed in Ollama, including qwen3:8b
  1. Leave Format on Simple. This setting is about how you write the prompt: Simple gives you one Prompt and one System Prompt field, while Advanced lets you write a list of messages. It has nothing to do with the shape of the answer.
  2. Set Prompt to the ticket data pill, and System Prompt to: "You triage customer support tickets. Pick the category and priority, and write a one-sentence summary."
  3. The shape of the answer is set under Response. Set Response Format to Structured data, then build the schema in Response Schema with three text fields, or import the template, which already has it. Ollama holds the model to the schema while it writes, so you always get JSON back in the same shape. The template's schema looks like this:
{
  "type": "object",
  "properties": {
    "category": { "type": "string", "enum": ["BILLING", "TECHNICAL", "SALES"] },
    "priority": { "type": "string", "enum": ["LOW", "MEDIUM", "HIGH"] },
    "summary": { "type": "string" }
  },
  "required": ["category", "priority", "summary"]
}
The configured Ollama Ask step: model qwen3:8b, Format set to Simple, the ticket data pill as the prompt, and a system prompt

If you'd rather not click through all of that, import the template and pick your connection.

Step 4: Run it

Give the ticket input a test value and click Test. Ours:

Hi, I upgraded to the Team plan yesterday and my card was charged twice - once for $49 and again for $49 a few minutes later. Our finance team needs this fixed before month-end close. Can you refund the duplicate charge?

The test run completed in 874 ms with category BILLING, priority HIGH, and a one-sentence summary

It came back BILLING, HIGH, with a summary that mentions the duplicate $49 charge, in 874 ms. Over three runs the classifier took 0.87 to 1.03 s, which is fast enough to run inside a webhook handler while the sender waits.

The first call is slower: 9.1 s, and 8.1 s of that is Ollama loading the model into GPU memory. By default Ollama unloads a model after five idle minutes. If tickets arrive all day, set Keep alive for on the Ask step (for example 30m) or OLLAMA_KEEP_ALIVE on the server, and only the first call after a quiet spell waits for the load.

Thinking: off by default, on when you need it

Qwen3 is a reasoning model, and unless you tell it not to, it "thinks" before it answers. ByteChef's Thinking option (under Advanced) is off by default, and when it's off, ByteChef tells Ollama to skip the reasoning. That makes a bigger difference than I expected. On the same ticket and schema:

ThinkingTimeTokens generatedAnswer
Off (default)0.89 s44BILLING / HIGH
On3.0 to 5.6 s146 to 289BILLING / HIGH

The answer was the same either way. For classification and extraction, reasoning only adds latency. Turn it on for the steps that need it, such as multi-step analysis, and pick a Reasoning effort.

When we first ran this, switching Thinking off did nothing, so Qwen3 reasoned anyway and every call took 3 to 6 times longer. That's fixed in ByteChef 0.36, so use 0.36 or later.

Step 5: Give an agent a local model and a tool

The Ask action makes one call and returns. An AI agent can also call tools, and with Qwen3 that works locally too. We built a small agent that works out a first-response deadline. High-priority tickets get four hours, and the agent has to look up the current time instead of guessing it:

  • AI Agent → Chat, with the system prompt "High-priority tickets must get a first response within 4 hours. Always call the Get current date tool first, then reply with the current time and the exact SLA deadline. Do not guess the date."
  • Model: the Ollama model element with qwen3:8b.
  • Tools: Date Helper → Get Current Date.

This agent is a template too, so you can import it instead of building it.

An AI Agent cluster with Ollama attached as the Model and Get current date attached as a Tool
The agent run completed in 2.1 s and answered with the current time and a deadline four hours later

The agent called the tool, got 12:31:22, and answered with a deadline of 16:31:22. That's two calls to the model (one to ask for the tool, one to write the answer) in 2.1 to 2.6 s. We only tested the tool call. Memory, guardrails and RAG attach the same way, whichever model you use.

RAG can stay local as well. The Ollama Embedding element works with a self-hosted vector store such as PgVector or Qdrant, so the documents you index don't leave your network either. We didn't measure that part for this post.

What an 8B model is good at, and where it struggles

A quantized 8B model is not a frontier model. In our testing it did well at:

  • Classification and routing. This is high-volume, easy work, where per-token pricing hurts the most.
  • Extraction into a structured-output schema.
  • Summarizing text you already have.
  • Short tool-using agents like the one above: one or two tools and a clear instruction.

Hosted frontier models still do better at long multi-step reasoning, picking the right tool out of many, careful writing, and hard analysis. We only tried one tool; with many tools to pick from, expect a hosted model to do noticeably better.

Mix local and hosted models in one workflow

You don't have to pick one model for everything. The model is an element you attach to each step, so you choose per step:

  • Keep anything that touches regulated data on the local model, and send only the redacted results to a hosted model for the harder reasoning.
  • Run the high-volume, easy steps (classification, embeddings) locally, and save the hosted model for the few steps that need it.

Moving a step from Ollama to a hosted provider, or back, means attaching a different model element. The rest of the workflow stays as it is.

FAQ

Does ByteChef work with Ollama?

Yes. ByteChef has an Ollama component with an Ask action, an Ollama model element for AI agents, and an Ollama Embedding element for RAG. All of them use an Ollama connection that points at your Ollama server's URL.

Which local model should I use for tool calling?

Qwen3 8B called the tool correctly in every run we did, and it needs only about 11 GB of memory when loaded. With a small model, give an agent one or two tools and a clear instruction.

How does ByteChef running in Docker reach Ollama?

If Ollama runs on the host, use http://host.docker.internal:11434 as the connection URL. If you start both with docker-compose.ollama.yml, use http://ollama:11434. localhost inside a container points at the container itself, not at your machine.

Why is the first call so slow?

Ollama has to load the model into memory first, which took 8.1 of the 9.1 seconds on our first call. After five idle minutes it unloads the model again. Set Keep alive for on the step, or OLLAMA_KEEP_ALIVE on the server, to keep it loaded.

Try it

That ticket with the duplicate $49 charge never left the laptop, and it was sorted in under a second.

To run it yourself: ollama pull qwen3:8b, import the ticket triage template or the SLA deadline agent template into a self-hosted ByteChef (0.36 or later) that can reach your Ollama server, and pick your Ollama connection.

Subscribe to the ByteChef Newsletter

Get the latest guides on complex automation, AI agents, and visual workflow best practices delivered to your inbox.

Related posts