5 ms·
Two years ago I wrote an agent in 25 lines of PHP [0]. It was surprisingly effective, even back then before tool calling was a thing and you had to coax the LLM
by dave1010uk 10mo ago
Two years ago I wrote an agent in 25 lines of PHP [0]. It was surprisingly effective, even back then before tool calling was a thing and you had to coax the LLM into returning structured output. I think it even worked with GPT-3.5 for trivial things.
In my mind LLMs are just UNIX strong manipulation tools like `sed` or `awk`: you give them an input and command and they give you an output. This is especially true if you use something like `llm` [1].
It then seems logical that you can compose calls to LLMs, loop and branch and combine them with other functions.
[0] https://github.com/dave1010/hubcap https://github.com/dave1010/hubcap
[1] https://github.com/simonw/llm https://github.com/simonw/llm
- simonw 10mo agoI love hubcap so much. It was a real eye-opener for me at the time, really impressive result for so little code. https://simonwillison.net/2023/Sep/6/hubcap/ https://simonwillison.net/2023/Sep/6/hubcap/
- dingnuts 10mo agoYou're posting too fast please slow down
- rolymath 10mo agoI agree. I'm getting too much simonw in my feed. Getting too saturated.
- dave1010uk 10mo agoThanks Simon! It only worked because of your LLM tool. Standing on the shoulders of giants.
- keyle 10mo ago> a small Autobot that you can't trust That gave me a hearty chuckle!
- nativeit 10mo agoI let it watch my kids. Was that a mistake? /s
- monarchwadia 10mo ago[dead]
- singularity2001 10mo agowhat's the point of specialized agents when you just have one universal agent that can do anything e.g. Claude
- baq 10mo agoIf you can get a specialized agent to work in its domain at 10% parameters of a foundation model, you can feasibly run locally, which opens up e.g. offline use cases. Personally I’d absolutely buy an LLM in a box which I could connect to my home assistant via usb.
- throwaway4012 10mo agoCan you (or someone else) explain how to do that? How much does it typically cost to create a specialized agents that uses a local model? I thought it was expensive?
- pegasus 10mo agoAn agent is just a program which invokes a model in a loop, adding resources like files to the context etc. It's easy to write such a program and it costs nothing, all the compute cost is in the LLM call. What parent was referring to most likely is fine-tuning a smaller model which can run locally, specialized for whatever task. Since it's fine-tuned for that particular task, the hope is that it will be able to perform as well as a general purpose frontier model at a fraction of the compute cost (and locally, hence privately as well).
- monomers 10mo agoWhat use cases do you imagine for LLMs in home automation? I have HA and a mini PC capable of running decently sized LLMs but all my home automation is super deterministic (e.g. close window covers 30 minutes after sunset, turn X light on if Y condition, etc.).
- baq 10mo agothe obvious is private, 100% local alexa/siri/google-like control of lights and blinds without having to conform to a very rigid structure, since the thing can be fed context with every request (e.g. user location, device which the user is talking to, etc.), and/or it could decide which data to fetch - either works. less obvious ones are complex requests to create one-off automations with lots of boilerplate, e.g. make outside lights red for a short while when somebody rings the doorbell on halloween.
- pjmlp 10mo agoAnd that is how we end up with iPaaS products powered by agentic runtimes, slowly dragging us away from programming language wars. Only a selected few get to argue about what is the best programming language for XYZ.
- deleted 10mo ago[deleted]
- saghm 10mo agoThe obvious difference between UNIX tools and LLMs is the non-determinism. You can't necessarily reason about what the output will be, and then continue to pipe into another LLM, etc., and eventually `eval` the result. From a technical perspective you can deal do this, but the hard part seems like it would be how to make sure it doesn't do something you really don't want it to do. I'd imagine that any potential deviations from your expectations in a given stage would be compounded as you continue to pipe along into additional stages that might have similar deviations. I'm not saying it's not worth doing, considering how the software development process we've already been using as an industry ends up with a lot of bugs in our code. (When talking about this with people who aren't technical, I sometimes like to say that the reason software has bugs in it is that we don't really have a good process for writing software without bugs at any significant scale, and it turns out that software is useful for enough stuff that we still write it knowing this). I do think I'd be pretty concerned with how I could model constraints in this type of workflow though. Right now, my fairly naive sense is that we've already moved the needle so far on how much easier it is to create new code than review it and notice bugs (despite starting from a place where it already was tilted in favor of creation over review) that I'm not convinced being able to create it even more efficiently and powerfully is something I'd find useful.