earendil-works

    earendil-works/pi

    #115 this week

    AI agent toolkit: unified LLM API, agent loop, TUI, coding agent CLI

    llm
    TypeScript
    MIT
    72.4K stars
    8.9K forks
    72.4K GitHub watchers
    Updated 7/18/2026
    View on GitHub

    Backblaze Generative Media Hackathon

    Build the next generation of AI media apps with Genblaze, stored on Backblaze B2. $10,000 in prizes.

    Enter the hackathon

    Loading star history...

    Use Cases & Benefits

    • Provides a comprehensive toolkit for building AI agents and managing large language model deployments with unified APIs and user interfaces.
    • Offers a unified multi-provider LLM API and integrated tools for seamless agent runtime, UI, and deployment management in one monorepo.
    • Use for developing interactive coding agents with CLI support that leverage multiple LLM providers for enhanced coding assistance.
    • Use for creating Slack bots that delegate user messages to AI coding agents, enabling AI-powered collaboration within teams.
    • Use for managing GPU pod deployments of vLLM models via CLI to efficiently scale and control AI inference workloads.

    About pi

    Pi Monorepo

    Tools for building AI agents and managing LLM deployments.

    Packages

    PackageDescription
    @mariozechner/pi-aiUnified multi-provider LLM API (OpenAI, Anthropic, Google, etc.)
    @mariozechner/pi-agentAgent runtime with tool calling and state management
    @mariozechner/pi-coding-agentInteractive coding agent CLI
    @mariozechner/pi-momSlack bot that delegates messages to the pi coding agent
    @mariozechner/pi-tuiTerminal UI library with differential rendering
    @mariozechner/pi-web-uiWeb components for AI chat interfaces
    @mariozechner/pi-proxyCORS proxy for browser-based LLM API calls
    @mariozechner/piCLI for managing vLLM deployments on GPU pods

    Development

    Setup

    npm install          # Install all dependencies
    npm run build        # Build all packages
    npm run check        # Lint, format, and type check
    

    CI

    GitHub Actions runs on push to main and on pull requests. The workflow runs npm run check and npm run test for each package in parallel.

    Do not add LLM API keys as secrets to this repository. Tests that require LLM access use describe.skipIf() to skip when API keys are missing. This is intentional:

    • PRs from external contributors would have access to secrets in the CI environment
    • Malicious PR code could exfiltrate API keys
    • Tests that need LLM calls are skipped on CI and run locally by developers who have keys configured

    If you need to run LLM-dependent tests, run them locally with your own API keys.

    Development

    Start watch builds for all packages:

    npm run dev
    

    Then run with tsx:

    cd packages/coding-agent && npx tsx src/cli.ts
    cd packages/pods && npx tsx src/cli.ts
    

    Versioning (Lockstep)

    All packages MUST always have the same version number. Use these commands to bump versions:

    npm run version:patch    # 0.7.5 -> 0.7.6
    npm run version:minor    # 0.7.5 -> 0.8.0
    npm run version:major    # 0.7.5 -> 1.0.0
    

    These commands:

    1. Update all package versions to the same number
    2. Update inter-package dependency versions (e.g., pi-agent depends on pi-ai@^0.7.7)
    3. Update package-lock.json

    Never manually edit version numbers. The lockstep system ensures consistency across the monorepo.

    Publishing

    Complete release process:

    1. Add changes to CHANGELOG.md (if changes affect coding-agent):

      # Add your changes to the [Unreleased] section in packages/coding-agent/CHANGELOG.md
      # Always add new entries under [Unreleased], never under already-released versions
      
    2. Bump version (all packages):

      npm run version:patch    # For bug fixes
      npm run version:minor    # For new features
      npm run version:major    # For breaking changes
      
    3. Finalize CHANGELOG.md for release (if changes affect coding-agent):

      # Change [Unreleased] to the new version number with today's date
      # e.g., ## [0.7.16] - 2025-11-17
      # NEVER add entries to already-released version sections
      # Each version section is immutable once released
      
    4. Commit and tag:

      git add .
      git commit -m "Release v0.7.16"
      git tag v0.7.16
      git push origin main
      git push origin v0.7.16
      
    5. Publish to npm:

      npm run publish        # Publish all packages to npm
      
    6. Add new [Unreleased] section (for next development cycle):

      # Add a new [Unreleased] section at the top of CHANGELOG.md
      # Commit: git commit -am "Add [Unreleased] section"
      

    License

    MIT

    Discover Repositories

    Search across tracked repositories by name or description