HackerTrans
TopNewTrendsCommentsPastAskShowJobs

rangersui

no profile record

Submissions

Show HN: Pythond, Persistent Python daemon where state survives across calls

pythond.sh
4 points·by rangersui·16 ngày trước·1 comments

Show HN: Elastik – treating LLM as an HTTP client in less than 200 lines of code

github.com
1 points·by rangersui·4 tháng trước·2 comments

comments

rangersui
·16 ngày trước·discuss
sshd gives you a shell, and pythond gives you a persistent python repl

I built pythond because every AI agent uses the one shot bash_tool, where the state cannot persist across its tool calls. It has to use python -c "import ..." or "export ..." every time, wasting tokens and cannot hold a long lived database connection or socket. We have a real bash terminal and the envs survive, but they act as if every time it's a new terminal.

Background tasks that help AI hold a persistent connection can work but they must be restarted if you want to change configs, or they need to provide a cli interface or an API for live operation. So instead of waiting for different softwares to have their cli interface, I thought that the most general purpose tool is something you can exec() right on the spot and that's exactly Python.

At first I was trying to give AI a real terminal but it was hell with ANSI and the terminal itself is a stream with a lot of noise rather than a structured call because of AI's natural tool use pattern.

AI is naturally a request-response commmunication model, so it needs a server or daemon to help it persist the status. The daemon shall not be any specific server, agent runtime or api, but the most primitive and convenient language, runtime: PYTHON.

Unlike Jupyter, it's CLI-native with no browser, with no .ipynb files. History are just stored in text and shell friendly. I was having fun with my AI locally and it uses this to do literally everything, and the bash tool becomes just a pipe for using pythond. Instead of writing python scripts and then run them, crash in the middle and then debug, the REPL allows AI to retry the code and do it step by step.

For remote usage, I was copying the secruity model of SSH using mTLS + token, and I know it's not a sandbox, since it's exactly an RCE running arbitrary python code. I would love feedback about the secruity model, my API design like run (sync), fire (async), fork behavior(POSIX only), poll (fetch async result), and attach (human can attach to the REPL agents are working at) and whether someone would actually use this

GitHub: https://github.com/rangersui/pythond Install: pip install pythond
rangersui
·4 tháng trước·discuss
Update: MCP aggregator, ChatGPT OpenAPI integration. Ollama offline support. Three AIs in one database.
rangersui
·4 tháng trước·discuss
Update: v1.1.0 shipped, auth on all POST routes, body size limits, path traversal protection, and a browser extension that sees what you see.

Six security layers, all physical isolation. No semantic guardrails needed.
rangersui
·4 tháng trước·discuss
I stopped caffeine entirely in high school after it caused severe diuretic effects during an exam.

What I noticed is that energy I thought was mostly placebo. Once I stopped expecting it to work, I didn't miss it. The article's point about caffeine not being a substitute for rest resonated. I just learned that lesson earlier than most.

The genetic variation angle is interesting though. I'm curious if people who are naturally caffeine-sensitive just end up not drinking coffee, or if the sensitivity itself is a separate genetic trait.