A small breakthrough for running local LLMs
Since the release of ChatGPT 3 back in January 2023, I was always interested in how the future would look when it comes to local LLMs. I think we have achieved it. at least somewhat.
Especially since the release of DeepSeek and OpenAI not being that dominant anymore, I would even suggest that people with enough hardware should run local LLMs.
I had left the local LLM niche for a while, but since Gemma3 was released, I put it on my workstation and even on my Thinkpad X12. It was really good for answering some simple questions, summarizing texts, or using it as a little helper for general tasks. Sure, it does not come near the big LLMs such as Claude, ChatGPT, and so on, but heck, back in 2023 we were not even able to get a single sentence out of them that made sense. Now they are able to replace searching Google. But still, I was not able to control Gemma to make it run some code only when needed. So I left that topic behind again.
But now, being in my last semester, I had the opportunity to dive into any topic I found interesting. And oh man, I dove into it.
So to keep it short: The developers who also release the Qwen LLM just made it really easy to dock ollama to your Python code and write some functions.
You can find it here: GitHub - QwenLM/Qwen-Agent: Agent framework and applications built upon Qwen
And here is a small snippet of how I embedded it into my university project. I built this RSS agent that can actually understand when someone asks about RSS feeds and then automatically scrapes them. The cool part is that the LLM doesn't just tell you "yeah, you should check that RSS feed" - it actually calls my RSS parsing function, fetches all the entries, and gives you back a structured JSON response with titles, links, and summaries. It's integrated into a FastAPI backend with session management, so each user gets their own persistent chat agent that remembers the conversation. The whole thing runs locally with Ollama, so no API costs and full privacy. What used to require manual parsing and multiple steps now just works by asking "hey, can you check this RSS feed for me?" in natural language.
=
=
: =
# print(value)
=
=
=
=
: =
return
=
=
# Verwende die geerbte Methode zur Parameter-Validierung
=
=
=
# Konvertiere das Ergebnis zu einem JSON-String
return
"""Basis-Agent-Klasse für Chat-Funktionalität mit History-Unterstützung"""
=
= or
= or
= or
: =
# Erstelle den Assistant
=
"""Sendet eine Nachricht an den Agenten und gibt die Antwort zurück"""
# Füge die Benutzernachricht zur History hinzu
=
=
# Füge die Bot-Antworten zur History hinzu
return
"""Gibt die komplette Chat-History zurück"""
return
"""Löscht die Chat-History"""
=
"""Gibt die letzte Bot-Antwort zurück (nützlich für API-Integration)"""
return
return
# LLM-Konfiguration
=
"""Erstellt einen einfachen Chat-Agenten"""
=
return
# Für FastAPI-Integration
"""Manager-Klasse für die Integration in FastAPI"""
: =
"""Holt oder erstellt einen Agenten für eine Session"""
=
return
"""Sendet eine Nachricht an den Agenten einer bestimmten Session"""
=
return