r/hermesagent • • 4h ago

Discussion Why is Hermes agent using python if it is so heavy and resource hungry? Why not Rust?

The current Hermes agent code is 75% python, why is that?

Now that a lot of softwares are switching up to GPUI because the Rust language is way faster and lighter in terms of resource usage, why isn't Hermes planning on doing the same?

I've been having a lot of performance issues on Hermes recently, and after diagnosing it, I realized that a good chunk of this it's because:

1 - it uses python, so in some tasks, just the python process uses up to 3-4gb of RAM

2 - it uses electron for its desktop interface, which is non sense based on all the other apps which are switching up and showing to us the insane difference (discord for example with the discord phoenix project)

Am I missing something?

0 Upvotes

16 comments sorted by

17

u/Larelle 4h ago

Because 100ms longer to prompt is irrelevant when LLMs take 10-30s to respond. Python also makes it really easy for LLMs and humans to understand & improve or adapt its code.

-5

u/PorqueColocarNome 3h ago

It is not really about the time itself but the performance, python is notably slower and you can find hundreds of comparisons on how python does the same job as another programming language but 1000x slower

6

u/Larelle 3h ago

The performance is 99.9% dictated by the response time of the LLM, which is in turn 95% dictated by the speed of copying the memory and 0% by Python.

1

u/DinoDevBR 3h ago

can you show us proof of that statement?

17

u/EvolvingDior 4h ago
  1. The Hermes gateway server used barely any resources.
  2. The entire machine learning ecosystem is built on Python.

7

u/krayon_kylie 4h ago

python good

python loyal

3

u/phoenixmatrix 4h ago

Python is very popular in the AI space because that's what MLEs used historically, and libraries like pytorch are really popular. The LLMs were history a touch better at python (and typescript) than many other languages because of their training data. 

I agree though, now with how good models are, I use rust for everything unless I have a very strong reason not to. And I've never coded in rust by hand before, lol.

5

u/radix- 4h ago

Why does every country speak a different language across the world rather than all speak Latin. A tree grows many limbs

2

u/kido5217 3h ago

Did you run it in profiler? What was taking most of the time? I guess you didn't.

2

u/fifi_galaxy 4h ago

More libraries, easier to read, more devs know how to read/write them, it it still not stable, etc. Hermes is more POC than a stable project. So many parts are still unpolished. No point make it load in 3 seconds, when UX looks much closer to Win98 than 2016 website.

1

u/3dprintinted 3h ago

Feel free to rewrite it

1

u/mmhorda 3h ago

I agree and I am actually rewriting hermes like agent on rust. So far it is in early alpha but it is already working and it is much faster.

1

u/RPG-Nerd 3h ago

I think Go would be a better model than Rust as hermes is not really CPU bound and Go routines tend to map well to IO bound software.

But, software with multiple agents, databases, and MCP servers is not the same as a simple chat app. You can fire up a simple chat app that talks to an LLM is a couple minutes in Python. The libraries are there and ready to go. It's the fastest and easiest path to get something that works, then you expand on it later.

Personally, I agree that Python is a bad choice for a project of this side, and the indent syntax can be especially difficult for LLMs to work with

1

u/Working-Pilot4503 3h ago

Scripting languages like Python and Typscript are appropriate for these parts of the system. Rust will have binary compatibility and compile time issues. Having to compile for changes is the trade off vs flexible scripting.

1

u/DinoDevBR 3h ago

OMG... FUCK RUST!

1

u/Ok-Star6663 4h ago

Yeah asking myself the same question