---
title: "Building Technical Customer support model using ollama"  
description: "This blog gives the practical knowledge that how can you create your own customized CLI based AI customer support model."  
author: "Yash Srivastava"  
published: 2026-06-08  
updated: 2026-06-10  
canonical: https://answers.mindstick.com/blog/377/building-technical-customer-support-model-using-ollama  
category: "technology"  
tags: ["ollama", "ai chatbot", "ai model", "llm"]  
reading_time: 3 minutes  

---

# Building Technical Customer support model using ollama

## Introduction

This blog is to provide the practical knowledge about how you can create your own customized CLI based AI customer support model according to your requirement. Basically there are few easy steps by using these steps you will be able to create your own Customized AI model.

### STEP 1:

Pull the AI model which you want to use for customization and model creation. here we will use “[*Mistral*](https://answers.mindstick.com/blog/344/understanding-ollama-models)”. Run this command in your terminal:

```plaintext
ollama run mistral
```

this command will find is this already present in your system or not, if it is not found then it will download the model and then execute.

**Check:** check your server is working or not using command:-

```plaintext
ollama serve
```

if page gets open it means server is running. Exit the model

```plaintext
ctrl + c or \bye
```

### STEP 2:

create a new file of your model name in your system with .py extention.

*example:-*

I am creating this file on desktop.

```plaintext
cli_bot.py
```

now write the simple logic:

```python
import requests
import json

OLLAMA_URL = "http://localhost:11434/api/chat"

SYSTEM_PROMPT = """
You are a professional customer support assistant for a tech company.
Rules:
- Be polite and helpful
- Give short, clear answers
"""

messages = [{"role": "system", "content": SYSTEM_PROMPT}]

print(" Bot Started (type 'exit' to stop)\n")

while True:
    user_input = input("You: ")

    if user_input.lower() == "exit":
        print("Bot: Goodbye!")
        break
    messages.append({"role": "user", "content": user_input})

    response = requests.post(
        OLLAMA_URL,
        json={
            "model": "mistral",
            "messages": messages,
            "stream": True
        },
        stream=True
    )
    print("Bot: ", end="", flush=True)

    full_reply = ""

    try:
        for line in response.iter_lines():
            if line:
                chunk = json.loads(line.decode("utf-8"))
                if "message" in chunk:
                    content = chunk["message"].get("content", "")
                    print(content, end="", flush=True)
                    full_reply += content
    except Exception as e:
        print("\nError:", e)
    print("\n")
    messages.append({"role": "assistant", "content": full_reply})
```

### STEP 3:

Now run the model:\
open your system terminal and enter the command:

```plaintext
cd desktop   #to reach the folder where you created the model file
python cli_bot.py   # to execute the model
```

Now the CLI based model is executed now you can enter your prompt related to technical questions and can get your answer in stream form.

## Test the model

```plaintext
user: my data connection is not working

bot: I'm sorry to hear that you're having trouble with your data connection. Here are a few steps you can take to troubleshoot the issue:

1. Check if your device is connected to the internet by visiting a website or using an app that requires an internet connection.
2. Make sure that airplane mode is turned off on your device.
3. Restart your device and try connecting to the internet again.
4. If you're using Wi-Fi, try turning it off and then back on, or try switching to cellular data if available.
5. If you're still having trouble, try resetting your network settings by going to Settings > General > Reset > Reset Network Settings. Be aware that this will erase all saved networks and passwords, so you'll need to re-enter them afterwards.
6. If none of these steps work, please contact our technical support team for further assistance. We're here to help!
```

*note:-the response of this model is according to the prompt I used in my system.*

read more about ollama:

previous topic: [Creating Custom AI Models with Modelfiles](https://answers.mindstick.com/blog/374/creating-custom-ai-models-with-modelfiles)\
next topic: [Building Technical Customer support model using .net](https://answers.mindstick.com/blog/385/building-technical-customer-support-model-using-dot-net)

---

Original Source: https://answers.mindstick.com/blog/377/building-technical-customer-support-model-using-ollama

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
