explaingit

robzolkos/pi-lifeline

Analysis updated 2026-06-24

32TypeScriptAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

Pi agent extension that lets a small local model phone a stronger advisor model for strategy when a research loop gets stuck, with conservative trigger thresholds and a per-session cap.

Mindmap

mindmap
  root((pi-lifeline))
    Inputs
      Experiment logs
      Question and context
      Advisor model config
    Outputs
      Strategy suggestions
      Trigger decisions
      Lifeline status
    Use Cases
      Unblock a stuck research loop
      Small model with big model advisor
      Cost capped advisor calls
    Tech Stack
      TypeScript
      Pi platform
      OpenAI
      Google
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Let a small local Pi agent call a stronger model for advice after three failed experiments

USE CASE 2

Cap advisor spend at ten calls per session with a five run minimum gap between calls

USE CASE 3

Smoke-test the extension end-to-end with PI_LIFELINE_FAKE_RESPONSE before paying for a real model

What is it built with?

TypeScriptPiOpenAIGoogle

How does it compare?

robzolkos/pi-lifelinejavlonbek1233/-neonbitejavlonbek1233/-neonbite-1
Stars323232
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderateeasyeasy
Complexity3/51/52/5
Audienceops devopsvibe codervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Needs the Pi command-line platform installed first, plus an advisor model API key unless you stick to PI_LIFELINE_FAKE_RESPONSE.

In plain English

pi-lifeline is an extension for Pi, a command-line agent platform. It is built around a specific scenario: you have a small or local AI model running an automated research loop, where it edits code, runs an experiment, logs the result, and tries again. When that loop gets stuck, pi-lifeline lets the small model phone a friend, meaning ask a larger, more capable model for advice on what to try next. The extension adds three things to Pi. A new tool called phone_a_friend takes a question, optional context, and a mode (ideas, critique, debug, or next_experiment) and routes it to a stronger advisor model that returns strategic suggestions rather than code. A slash command /lifeline shows the current configuration, thresholds, and how many advisor calls have been used this session. A trigger system watches log_experiment results and decides when calling the advisor is worth the money. The defaults are conservative on purpose. Out of the box the extension only triggers after three consecutive failed experiments or six runs with no improvement, with a minimum of five runs between calls and a hard cap of ten calls per session. The default action is to nudge, which means it asks the agent to call phone_a_friend rather than calling silently, so the cost is visible. Setting the action to ask flips it into fully automatic mode. Installation is done with pi install npm:pi-lifeline followed by /reload. A /lifeline init wizard writes a starter config to ~/.pi/agent/pi-lifeline.json where you can pick the advisor provider (for example OpenAI or Google), the advisor model, the thinking level, token limits, and the trigger thresholds. Environment variables are also accepted, and a PI_LIFELINE_FAKE_RESPONSE variable lets you smoke-test the extension without spending tokens on a real model. The README finishes with a five-step validation plan: static type-check, unit tests for the trigger policy, a fake-advisor smoke test, an autoresearch fixture smoke test that feeds in a small JSONL log to confirm the trigger fires, and a real-advisor smoke test using a cheap model. The design notes stress that the small model stays in charge of edits and experiments, the strong model is only ever consulted for strategy.

Copy-paste prompts

Prompt 1
Walk me through the phone_a_friend tool in pi-lifeline and what changes between the ideas, critique, debug, and next_experiment modes
Prompt 2
Show me how the trigger policy decides to fire based on log_experiment results and consecutive failures
Prompt 3
Help me edit ~/.pi/agent/pi-lifeline.json to use a cheaper advisor model with a tighter session cap
Prompt 4
Run the five-step validation plan in pi-lifeline from static type check to real advisor smoke test
Prompt 5
Explain the difference between nudge and ask actions in pi-lifeline and when to use each

Frequently asked questions

What is pi-lifeline?

Pi agent extension that lets a small local model phone a stronger advisor model for strategy when a research loop gets stuck, with conservative trigger thresholds and a per-session cap.

What language is pi-lifeline written in?

Mainly TypeScript. The stack also includes TypeScript, Pi, OpenAI.

How hard is pi-lifeline to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is pi-lifeline for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.