EveryDev.ai
Subscribe
Home
Tools

3,723+ AI tools

  • New
  • Trending
  • Featured
  • Compare
  • Arena
Categories
  • Agents2189
  • Coding1574
  • Infrastructure698
  • Marketing534
  • Projects498
  • Research456
  • Design416
  • Analytics389
  • Testing296
  • MCP290
  • Security286
  • Data262
  • Integration197
  • Prompts189
  • Communication183
  • Extensions173
  • Learning170
  • Voice151
  • Commerce135
  • DevOps123
  • Web86
  • Finance26
AI Tools by Topic
  • AI Coding Assistants
  • Agent Frameworks
  • MCP Servers
  • AI Prompt Tools
  • Vibe Coding Tools
  • AI Design Tools
  • AI Database Tools
  • AI Website Builders
  • AI Testing Tools
  • LLM Evaluations
Follow Us
  • X / Twitter
  • LinkedIn
  • Reddit
  • Discord
  • Threads
  • Bluesky
  • Mastodon
  • YouTube
  • GitHub
  • Instagram
Get Started
  • About
  • Editorial Standards
  • Corrections & Disclosures
  • Community Guidelines
  • Advertise
  • Contact Us
  • Newsletter
  • Submit a Tool
  • Start a Discussion
  • Write A Blog
  • Share A Build
  • Terms of Service
  • Privacy Policy
Explore with AI
  • ChatGPT
  • Gemini
  • Claude
  • Grok
  • Perplexity
Agent Experience
  • llms.txt
Theme
With AI, Everyone is a Dev. EveryDev.ai © 2026
    1. Home
    2. Tools
    3. spec-ptc
    spec-ptc icon

    spec-ptc

    Agent Harness
    Featured

    Speculative programmatic tool calling (sPTC) library that queues and executes tool calls asynchronously while an LLM streams code, overlapping execution with generation time.

    Visit Website

    At a Glance

    Pricing
    Open Source

    Fully free and open-source under the MIT License. Install via pip or clone from GitHub.

    Engagement

    Available On

    CLI
    API
    SDK

    Resources

    WebsiteGitHubllms.txt

    Topics

    Agent HarnessAgent FrameworksAI Development Libraries

    Alternatives

    OpenHarnessClaude Agent SDKFlue
    Developer
    Alex ZhangAlex Zhang builds open-source tools for reinforcement learni…

    Listed Aug 2026

    About spec-ptc

    sPTC (Speculative Programmatic Tool Calling) is an open-source Python library by Alex Zhang that accelerates LLM agent harnesses by speculatively launching tool calls while the model is still generating code. It targets harness designs like Recursive Language Models (RLMs) and CodeAct that rely on programmatic tool-calling (PTC), where all tools are embedded as functions inside a single code REPL. The library is available on PyPI (pip install spec-ptc) and is licensed under MIT.

    What It Is

    sPTC is a latency-reduction technique for LLM agent harnesses that use a code REPL as their primary tool interface. In a standard (baseline) setup, the LLM generates a full code block, then executes it serially — each tool call blocks until the previous one finishes. sPTC instead monitors the token stream as it arrives, detects completed function-call statements in the partially-generated code, and speculatively launches those calls as Futures. By the time the full code block is ready to execute, many expensive sub-LLM or sub-agent calls have already returned, so the exec step hits cached results almost immediately.

    baseline   tokens──────────────────▶ exec: call₁──▶call₂──▶…──▶callₙ──▶ answer
    spec-ptc   tokens──────────────────▶ exec: claim·claim·claim ──▶ answer
                     ╲ call₁ ▶▶▶ done ╱
                      ╲ call₂ ▶▶▶ done╱
    

    Core Architecture

    The library centers on a Speculator object that tracks registered tools and manages a shadow REPL used for speculation:

    • @spec.tool decorator — marks functions as speculatable (must be pure/side-effect-free) or non-speculatable (e.g., send_report).
    • spec.turn() context manager — snapshots REPL locals into a discarded shadow fork for the duration of one turn.
    • t.feed(delta) — accepts streamed tokens; closed statements trigger speculative launches immediately.
    • spec.hooks() — injects claim-or-run wrappers under the same function names into the REPL namespace, so the actual exec call hits cached results or falls back transparently.

    For out-of-process use, a daemon (spec-ptc-daemon) exposes the same shadow-plus-store over a Unix socket using four JSON-lines messages: turn_begin, feed, resolve, and turn_end. A minimal SpecClient (~60 lines, stdlib only) is provided for integration.

    Supported Harnesses and Plugins

    The repository ships wrappers in a plugins/ directory targeting:

    • RLM (Recursive Language Models) — one-line patch: from demo.rlm import patch_rlm; patch_rlm()
    • Claude Code (PreToolUse hook)
    • OpenCode
    • Pi-mono

    The technique is designed to be harness-agnostic; any system that streams tokens into a code REPL and then executes the result can adopt sPTC with minimal changes.

    Update: v0.1.1 (async + hook fix)

    The latest release, v0.1.1, was published on 2026-08-24 and addresses async support and a hook fix. The repository was created on 2026-08-21 and has accumulated 158 stars and 12 forks in its first week, signaling early community interest. Open issues stand at zero as of the last update on 2026-08-26.

    Why It Matters

    Sub-LLM and sub-agent calls are typically the dominant cost in RLM-style harnesses — they block execution and inflate wall-clock latency. sPTC reframes generation time as useful compute time by overlapping speculative calls with token streaming. Because speculation is gated on the pure=True flag, side-effectful tools are never speculatively executed, preserving correctness. The approach requires no changes to the underlying model or REPL logic, only the insertion of claim-or-run hooks and a token feed loop.

    spec-ptc - 1

    Community Discussions

    Be the first to start a conversation about spec-ptc

    Share your experience with spec-ptc, ask questions, or help others learn from your insights.

    Pricing

    OPEN SOURCE

    Open Source

    Fully free and open-source under the MIT License. Install via pip or clone from GitHub.

    • MIT License
    • Full source code access
    • pip install spec-ptc
    • Daemon and plugin support
    • Community contributions welcome

    Capabilities

    Key Features

    • Speculative tool call execution during LLM token streaming
    • Async and sync tool support via @spec.tool decorator
    • Pure/side-effect-free tool gating for safe speculation
    • Shadow REPL fork per turn for isolated speculation
    • Out-of-process daemon with JSON-lines socket protocol
    • SpecClient for harness integration (~60 lines, stdlib only)
    • Plugins for Claude Code, OpenCode, Pi-mono, and RLM
    • One-line RLM patch integration
    • Claim-or-run hook injection into existing REPL namespaces
    • PyPI installable (pip install spec-ptc)

    Integrations

    Claude Code
    OpenCode
    Pi-mono
    RLM (Recursive Language Models)
    CodeAct
    Anthropic Claude (programmatic tool-calling)
    PyPI
    API Available

    Ratings & Reviews

    No ratings yet

    Be the first to rate spec-ptc and help others make informed decisions.

    Developer

    Alex Zhang

    Alex Zhang builds open-source tools for reinforcement learning applied to language models. The project focuses on providing accessible RL utilities for LLM researchers and practitioners.

    Read more about Alex Zhang
    WebsiteGitHub
    2 tools in directory

    Similar Tools

    OpenHarness icon

    OpenHarness

    A composable, open-source TypeScript SDK for building powerful AI agent harnesses with stateless primitives, middleware, and hierarchical subagents on any model provider.

    Claude Agent SDK icon

    Claude Agent SDK

    Build production AI agents with Claude Code as a library, programmable in Python and TypeScript with built-in tools, hooks, subagents, MCP, and sessions.

    Flue icon

    Flue

    Flue is a TypeScript agent harness framework for building headless, programmable AI agents that deploy anywhere — Node.js, Cloudflare, GitHub Actions, and more.

    Browse all tools

    Related Topics

    Agent Harness

    Infrastructure, orchestrators, and task runners that wrap around LLM coding agents — covering session management, context delivery, worktree isolation, architecture enforcement, and issue-to-PR pipelines.

    155 tools

    Agent Frameworks

    Tools and platforms for building and deploying custom AI agents.

    655 tools

    AI Development Libraries

    Programming libraries and frameworks that provide machine learning capabilities, model integration, and AI functionality for developers.

    296 tools
    Browse all topics
    Back to all toolsSuggest an edit
    ratings
    discussions