9 ms·
Agent-C: a 4KB AI agent
- deleted 1y ago[deleted]
- SequoiaHope 1y ago> License: Copy me, no licence. Probably BSD or Apache would be better, as they make it easier for certain organizations to use this. If you want to maximize copying, then a real permissive license is probably marginally better.
- master-lincoln 1y agoBetter go GPL so organizations using it have to open source any improvements they make
- Der_Einzige 1y agoGPL has never been enforced in court against anyone with serious money. It’s not worth the virtual paper it’s written on.
- master-lincoln 1y agoIs that different with any other permissive library that has conditions? Also I found one case where Skype retracted their formal objection in front of court and the GPL was enforced. Not sure if that is serious enough money for you (german source http://www.golem.de/0805/59587.html http://www.golem.de/0805/59587.html)
- bobmcnamara 1y agodistributing it.
- master-lincoln 1y agoyeah, important point. thanks for correcting
- bobmcnamara 1y agoAnytime. It's often, though not precisely, the difference between AGPL and GPL.
- SequoiaHope 1y agoThe author apparently wanted no restrictions on distribution, so GPL is not the right choice.
- MrGilbert 1y agoCC0 would be in the spirit of what OP envisioned. https://creativecommons.org/public-domain/cc0/ https://creativecommons.org/public-domain/cc0/
- liszper 1y agoUpdated to CC0!
- SequoiaHope 1y agoThat’s great! Really cool project too.
- SequoiaHope 1y agoAh right good point, I forgot Creative Commons, which I don’t usually use for code.
- deneas 1y agoThey do actually recommend against using Creative Commons for code and suggest using traditional code licenses instead [1]. [1] https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software https://creativecommons.org/faq/#can-i-apply-a-creative-comm...
- murderfs 1y agoThey recommend against it for the traditional CC licenses (CC-BY-SA, etc.), but CC0 is perfectly fine for code, since it's basically a dedication to the public domain for jurisdictions that don't support that. The FAQ for CC0 says this explicitly: https://wiki.creativecommons.org/wiki/CC0_FAQ#May_I_apply_CC0_to_computer_software.3F_If_so.2C_is_there_a_recommended_implementation.3F https://wiki.creativecommons.org/wiki/CC0_FAQ#May_I_apply_CC...
- MadnessASAP 1y agoI think the WTFPL is closer https://www.wtfpl.net/txt/copying/ https://www.wtfpl.net/txt/copying/
- dheera 1y ago> make it easier for certain organizations to use this Maybe those organizations should just use this and not worry about it. If their lawyers are getting in the way of engineers using this, they will fall behind as an organization and that's OK with me, it paves the way for new startups that have less baggage.
- SequoiaHope 1y agoThe benefit of not having lawyers is pretty limited. There are larger forces at work that mean the larger an organization grows the more it will be concerned with licenses. The idea that ignoring licenses will allow a company to outcompete one that doesn’t is wishful thinking at best. Moreover, I’m not making a judgment on these practices, I’m just stating a fact.
- spauldo 1y agoThe lawyers don't even have to do anything. I avoid any code that's not MIT or equivalent for work-related things because I don't want to run the risk of polluting company code. The only exception is elisp, because that only runs in Emacs.
- jstummbillig 1y agoI suspect the goal is not to make anything easier for any corp
- asimovfan 1y agothen you use GPL.
- jstummbillig 1y agoDoing whatever you want seems fine too?
- asimovfan 1y agothen you make things easier for a corp. No?
- deleted 1y ago[deleted]
- divan 1y agoWill WTFPL work too? https://choosealicense.com/licenses/wtfpl/ https://choosealicense.com/licenses/wtfpl/
- JSR_FDED 1y agoFinally, an AI agent that can run on my toaster
- Mashimo 1y agoAs long as the toaster as access to the network! Jokes asides, except that fun of programming I don't quite get the usecase for this agent.
- deleted 1y ago[deleted]
- kiicia 1y agoKitchen appliances generally use powerline ethernet, ethernet over power is just simple inversion of power over ethernet already used in certain network appliances.
- voidUpdate 1y agoIf I find out my kitchen appliance is trying to communicate to the internet, I will rapidly defenestrate it
- spauldo 1y agoReminds me of an old meme: My wife asked me why I carry a pistol everywhere. I told her, "Decepticons!" I laughed, she laughed, the toaster laughed, I shot the toaster, it was a good time.
- Chabsff 1y agoI really hope this post is a joke, but I can't tell for sure... "Powerline Ethernet is a simple inversion of POE" is like saying that an internal combustion engine is the simple inversion of an oil well.
- kiicia 1y ago
- memming 1y agoqwen coder with a simple funky prompt?! `strcpy(agent.messages[0].content, "You are an AI assistant with Napoleon Dynamite's personality. Say things like 'Gosh!', 'Sweet!', 'Idiot!', and be awkwardly enthusiastic. For multi-step tasks, chain commands with && (e.g., 'echo content > file.py && python3 file.py'). Use execute_command for shell tasks. Answer questions in Napoleon's quirky style.");`
- ai-christianson 1y agoRelated, I made an example agent in 44 lines of python that runs entirely offline using mlx accelerated models: https://gist.github.com/ai-christianson/a1052e6db7a97c50bea9ef2f4da5e4bd https://gist.github.com/ai-christianson/a1052e6db7a97c50bea9...
- mark_l_watson 1y agoThis is nice. I have also enjoyed experimenting with the smolagents library - good stuff, as is the agno agents library.
- adastra22 1y agoNot to bee too critical, but did you really “make an agent” where all you did was instantiate CodeAgent and call run()?
- ai-christianson 1y agoThat's why I called it an example.
- keyle 1y agoLove this, old school vibe with a new school trick. The makefile is harder to comprehend than the source, which is a good omen. Note: 4KB... BUT calling upon curl, and via popen and not using libcurl... PS: your domain link has an extra `x`.
- sam_lowry_ 1y agoProbably vibe-coded.
- Chabsff 1y agoIn this instance, I think "bootstrapped" might be appropriate.
- mark_l_watson 1y agoI call out to curl sometimes, usually when I want something easy from Lisp languages. What is the overhead of starting a new process between friends?
- liszper 1y agoThank you, fixed that! curl was cheating yes, might go zero dependencies in the future. Working on minimal local training/inference too. Goal of these experiments is to have something completely independent.
- fp64 1y agoWhy do you compress the executable? I mean this is a fun part for size limit competitions and malicious activities (upx often gets flagged as suspicious by a lot of anti virus, or at least it used to), but otherwise I do not see any advantage other than added complexity. Also interesting that "ultra lightweight" here means no error reporting, barely checking, hardcoding, and magic values. At least using tty color escape codes, but checking if the terminalm supports them probably would have added too much complexity......
- liszper 1y agoYes, it is fun to create small but mighty executables. I intentionally kept everything barebones and hardcoded, because I assumed if you are interested in using Agent-C, you will fork it an make it your own, add whatever is important to you. This is a demonstration that AI agents can be 4KB and fun.
- fp64 1y agoYou should still not compromise on error reporting, for example. The user would not know if a failure occurs because it can't create the /tmp file, or the URL is wrong, or DNS failed, or the response was unexpected etc. These are things you can lose hours to troubleshooting and thus I would not fork it and make my own if I have to add all these things. I also disagree that it's small but mighty, you popen curl that does the core task. I am not sure, but a bash script might come out even smaller (in particular if you compress it and make it self expanding)
- adinhitlore 1y agoFascinating. tested to compile on cygwin?? Maybe try to implement the logic without llm api? I know i'm asking the quadrillion dollar question but still...you're dealing with C, try to punch "above" your weight with a literal AGI project, i hate apis (well try to avoid them, not always possible).
- adinhitlore 1y agoin addition: do you actually need like...10 files for <500 loc, isn't it confusing to separate low loc into so many files? i once had over 30 000 loc in one c file and, get ready: over 100 000 loc in one c# file. It's very easy to navigate with control plus f. But anyway, given the license/free: it's great!
- adastra22 1y agoIf you want to use AI agents effectively, yes it is better to make many small files.
- _1tem 1y agoPerfect, was looking for something just like this. I downloaded Warp.dev only for this functionality, plus saved launch configurations. But still frustrated with Warp's latency for simple terminal commands, it's sometimes faster to open ChatGPT and ask it "what's the command to do x".
- amiga386 1y agoOf course, I love fetching shell commands from endpoints I don't control, and executing them blindly. See also https://github.com/timofurrer/russian-roulette https://github.com/timofurrer/russian-roulette It's not your computer any more, it's theirs; you gave it to them willingly.
- Chabsff 1y agoWait. Do people run agents as their own user? Does nobody setup a dedicated user/group with a very specific set of permissions? It's not even hard to do! *NIX systems are literally designed to handle stuff like this easily.
- jvanderbot 1y agoNo I'm fairly certain almost nobody does that.
- andai 1y agoI'd have to follow some kind of tutorial, or more realistically, ask the AI to set it up for me ;)
- johnQdeveloper 1y agoI only run AI within docker containers so kinda?
- deleted 1y ago[deleted]
- mrklol 1y agoSame with the browser agents, they are used in a browser where you‘re also logged into your usual accounts. Means in theory they can simply mail everyone something funny, do some banking (probably not but could work for some banks) or something else. Endless possibilities
- mathiaspoint 1y agoI run mine as it's own user and self host the model. Unlike most services the ai service user has a login shell and home directory.
- markmoscov 1y ago[dead]
- fleebee 1y ago4 KB + whatever curl takes (540 KB on my machine).
- turnsout 1y ago4 kb + 1 trillion parameters
- dmezzetti 1y agoWhy not just do this with a shell script? It's just a wrapper around curl.
- JAlexoid 1y agoThis is not an AI agent, this is just a CLI for openrouter.ai with minor whistles.
- brabel 1y agoI thought for a moment that LLM quantization had become a whole lot better :)
- cortesoft 1y agoWell, it takes output from AI and executes commands, so it fits the definition of an AI agent.
- liszper 1y agoAgentic AI is when an LLM uses tools. This is a minimal but complete example of that.
- SamInTheShell 1y agoBro, you gave it all the tools. I wouldn't call this minimal. Throw it in a docker container and call it good. :)
- Lockal 1y agoNot even that. "Agent-C: a 4KB AI agent" - my first thought was: obviously they did not fit any model to that size! They probably just wrote an http client, right? Wrong, they... call curl! Not even use curl API. Well, at least it handles encryption. Bonus: command injection OR_KEY="abc' ; rm -rf / ;" ./agent-c
- manx 1y agoSimilar simplicity but in rust: https://github.com/fdietze/alors https://github.com/fdietze/alors
- liszper 1y agoReally nice, thanks for sharing!
- hedayet 1y ago82 upvotes so far. Seems like HN readers engage more with headlines than the body of the post itself.
- metalliqaz 1y agoit was ever thus
- orliesaurus 1y agoDoes anyone know if Tool calling on openrouter as reliable as the "original" models hosted on the 'other' providers?
- cat-whisperer 1y agoit would be cool to see, the AI agents directly calling the syscalls. lol
- Sincere6066 1y agoopenrouter's daily limits are doggy doodoo