Tag: pi.dev

  • My harness, or whatever that means

    That’s one of those words that, one year ago without context in a question, it could get you off guard. Today it appears to be pretty common in conversations.

    Of course I’m talking about the tools one uses to interact with LLMs and manage agent execution.

    Even though in the past I’ve written about my preference for local AI and even shared my setup at the time, I don’t give that much usage to any AI apart from using it as a coding assistant.

    I see value in things like asking it to review my code changes to ensure I haven’t forgotten anything, to generate boilerplace or even to “discuss” about the up and downsides of possible implementations to a given problem.

    I don’t have one of those setups that are meant to do everything, replace the human, and have a life of their own.

    So as you might guess, my harness is pretty simple. I essentially still use Ollama to serve some local models (that aren’t too slow on my machine). Then I use a containerized instance of pi.dev that I launch in the project directory I’m working in at a given moment.

    The container image is heavily inspired by the one suggested in the docs:

    FROM node:26-trixie
    
    RUN apt-get update --yes \
        && apt-get install --yes --no-install-recommends curl git postgresql-client ripgrep fd-find
    
    RUN curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Install the coding agent globally and ensure the work directory has correct permissions
    RUN npm install -g --ignore-scripts @earendil-works/pi-coding-agent \
        && mkdir -p /work \
        && chown node:node /work
    
    USER node
    
    WORKDIR /work
    
    ENTRYPOINT ["pi"]

    I also created a shell alias, so I can just call pi anywhere and launch the containerized agent:

    alias pi='docker run --rm -it -v "$(pwd)":/work -v ~/.pi:/home/node/.pi/ -w /work agent_image'

    And that’s essentially it. Very useful and with some isolation from the host system.

    One of my concerns is definitely the security of my machine and data. Since the models that I use are relatively limited, a container should be enough.

    I’ve read many people suggest that it is preferable and equally practical to rely on virtual machines. I will probably upgrade in the future. However, it seems that for frontier models, even a VM won’t be enough to properly isolate the agents.

    I also thought about using a dedicated tool such as nono, but the limited use I give it doesn’t seem worth the effort for now.

    Fediverse Reactions