npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-doctor

v2.0.4

Published

Fix OpenAI 429 errors, timeouts, streaming issues, retry loops, and token cost spikes across OpenAI, Claude, Gemini, LangChain, OpenClaw, and other LLM stacks.

Readme

AI Doctor - Fix OpenAI 429 Errors, Timeouts & Streaming Issues

Works across OpenAI, Claude, Gemini, OpenClaw, LangChain, and other LLM stacks.

Fix common LLM API errors like 429 rate limits, timeouts, streaming hangs, retry loops, and runaway token costs.

AI Doctor scans your codebase and shows exactly what is breaking - then helps you fix it automatically.


Works with

Providers

  • OpenAI API
  • Anthropic Claude API
  • Google Gemini API
  • Grok
  • OpenRouter
  • Together AI
  • Fireworks AI
  • Replicate
  • DeepSeek, Mistral, Cohere (OpenAI-compatible)

Frameworks & SDKs

  • OpenClaw
  • LangChain
  • Vercel AI SDK
  • LlamaIndex
  • Custom OpenAI-compatible clients
  • Node.js / JavaScript backends

Quick start

npx ai-doctor

Takes ~30 seconds. No config needed.

What AI Doctor detects & fixes

Rate limits (429 errors)

  • Fix OpenAI 429 RESOURCE_EXHAUSTED
  • Fix LangChain / OpenClaw retry issues
  • Add exponential backoff + jitter
  • Handle Retry-After correctly

Timeouts & hanging requests

  • Fix context deadline exceeded
  • Fix Vercel AI SDK timeout issues
  • Prevent stuck API calls
  • Add safe timeout guards

Streaming issues (SSE problems)

  • Fix OpenAI / Claude streaming hangs
  • Fix incomplete responses
  • Fix SSE not flushing correctly
  • Detect broken streaming pipelines

Retry problems

  • Fix retry storms in LangChain / custom code
  • Add retry limits
  • Prevent infinite loops

Cost issues

  • Prevent runaway token usage
  • Fix missing or incorrect max_tokens
  • Reduce unexpected cost spikes

Debugging & traceability

  • Add request IDs
  • Fix missing correlation IDs
  • Improve logging for production debugging

Common errors this helps with

  • 429 RESOURCE_EXHAUSTED
  • context deadline exceeded
  • socket hang up
  • ECONNRESET
  • 504 Gateway Timeout
  • streaming response stuck / incomplete
  • OpenAI timeout errors
  • Claude streaming issues
  • Gemini API failures
  • LangChain retry bugs
  • OpenClaw streaming / retry issues

Why use AI Doctor?

Most AI apps break in the same ways:

  • Bad retry logic -> 429 errors + rate limits
  • No timeouts -> requests hang forever
  • Broken streaming -> partial responses
  • No token limits -> runaway costs
  • No tracing -> hard to debug production issues

AI Doctor finds all of this automatically.

Commands

npx ai-doctor           # Scan + interactive fix
npx ai-doctor --fix     # Auto-fix issues
npx ai-doctor --ci      # Report only (CI mode)

Install

npm install -g ai-doctor

Documentation

https://github.com/michaelbrinkworth/ai-patch-doctor

Keywords

  • openai 429 error fix
  • openai timeout fix
  • openai streaming issue
  • langchain 429 error
  • vercel ai sdk timeout
  • openclaw streaming issue
  • anthropic api error fix
  • gemini api timeout
  • llm retry logic
  • llm debugging tool
  • llm cost control
  • ai api errors
  • llm observability cli

MIT License - Fix your AI API issues in minutes.