r/LocalLLaMA · · 1 min read

It turns out Bash is All You Need to write a language model REPL (and jq and curl)

Mirrored from r/LocalLLaMA for archival readability. Support the source by reading on the original site.

While working on an self-educational exercise tinkering with local models and trying my hand at setting up agents, I went down a rabbit hole: to see how far I could build a custom agent REPL loop using exclusively command-line building blocks and stripping out dependencies wherever possible.

It turns out you can get pretty far with pipes, text streams, append only logs, and standard command-line components - concepts pretty well aligned with classic Unix philosophy. The agent is a wrapper composed of a handful of smaller programs, which should allow for flexibly injecting various tool to inspect, filter, redirect, and audit different stages of the agent loop.

Some features that may be of interest:

  • Minimal dependencies: no Python, NodeJS, etc., and the core command-line components should be widely available on most modern Unix-adjacent environments
  • Plug-and-play backend: the agent-model boundary is scoped to a single command-line tool, which should allow for portability across different model providers
  • Simple, transparent state: agent memory/context is stored in an append-only history file, which allows for easy introspection, modification, rewinding, and more.

I put the code up here if anyone wants to poke around: https://github.com/cloudkj/llayer

Hope you find it interesting. Curious to hear what you think!

submitted by /u/cloud_kj
[link] [comments]

Discussion (0)

Sign in to join the discussion. Free account, 30 seconds — email code or GitHub.

Sign in →

No comments yet. Sign in and be the first to say something.

More from r/LocalLLaMA