AI & LLM API Errors
Rate limits, context windows, GPU memory and model-serving failures.
Understanding AI errors
AI and LLM errors cluster into four families: quota and rate limiting (429s, insufficient_quota), context window overflow (the prompt plus the requested completion exceeds the model's limit), accelerator memory (CUDA OOM, KV-cache exhaustion), and content policy (a refusal or safety stop rather than a transport failure). The first thing to establish is which family you are in, because the fixes have nothing in common: a 429 wants backoff and a quota increase, a context overflow wants truncation or chunking, and a CUDA OOM wants a smaller batch or a quantised model.
How to debug AI errors
- Read the error body, not just the status code. Providers put the real reason in a JSON
error.type/error.codefield:rate_limit_exceededandinsufficient_quotaare both HTTP 429 but mean completely different things. - Count your tokens before you send. Use the provider's tokenizer (tiktoken, Anthropic's count-tokens endpoint) rather than guessing from character length, and remember that
max_tokensfor the response is reserved inside the context window. - For local inference, watch VRAM live with
nvidia-smi -l 1while the request runs. Memory that peaks during the forward pass rather than at load time points at batch size or sequence length, not at model weights. - Distinguish a refusal from a failure. A
stop_reasonofrefusal, or afinishReasonofSAFETY, is a successful HTTP 200. Retrying identical input will produce the same result. - Always implement exponential backoff with jitter and honour the
retry-afterheader. Most production LLM incidents are self-inflicted retry storms.
Tools worth reaching for
tiktokennvidia-smicurl -iprovider status pages
All 35 AI errors
- Anthropic API: 429 rate_limit_error (tokens per minute) NewThe organisation exceeded its input or output token budget for the minute, not its request count. Large prompts burn…
- Anthropic API: invalid_request_error on tool_use / tool_result NewTool calling requires strict message pairing: every assistant tool_use block must be answered by a user message…
- Anthropic API: Overloaded (529)The Anthropic API is temporarily overloaded and cannot process your request. This is a transient server-side issue.
- Anthropic API: prompt is too long / context window exceededInput tokens plus requested output tokens exceed the selected model's context window.
- AWS Bedrock: AccessDeniedException (no access to the model) NewBedrock foundation models must be explicitly enabled per account and per region before they can be invoked, in…
- Azure OpenAI: DeploymentNotFound NewAzure OpenAI addresses a *deployment name* you chose, not the underlying model name. Passing 'gpt-4o' when the…
- Claude: response blocked / safety refusalThe model declined to answer because the prompt matched a disallowed or ambiguous safety category. Provide a clearer…
- CUDA: driver version is insufficient for CUDA runtime version NewThe installed NVIDIA driver is older than the CUDA runtime the framework was built against. Drivers are backwards…
- CUDA: no kernel image is available for execution on the device NewThe binary contains no compiled code for your GPU's compute capability. It happens with a wheel built for older…
- Gemini API: response blocked (finishReason: SAFETY)Gemini stopped generation because the prompt or candidate tripped a safety category threshold, leaving no usable text.
- GitHub Copilot: authentication failed / no subscriptionThe Copilot extension cannot authenticate: the GitHub session expired, there is no active Copilot seat, or a proxy is…
- Hugging Face: 401 Cannot access gated repo NewThe model or dataset requires you to accept its licence and authenticate. Anonymous downloads that worked for other…
- HuggingFace/PyTorch: CUDA version mismatchThe installed PyTorch version was compiled for a different CUDA version than what's available on the system.
- LangChain: OutputParserException, could not parse LLM output NewThe parser expected strict JSON or a fixed agent format and the model returned prose, a fenced code block or a…
- LangChain: Token limit exceeded for chainThe combined input (prompt + context + history) exceeds the model's context window size.
- LLM: structured output does not match the requested JSON schema NewThe model returned prose, a truncated object, or JSON that violates the schema. Usually the response hit the token…
- MCP: server connection failed / failed to start NewA Model Context Protocol client could not start or speak to a server. For stdio servers the command is usually wrong…
- Mistral API: 422 Unprocessable EntityThe request body failed validation: unknown model name, malformed messages array, or an unsupported parameter value.
- Ollama: connection refused on localhost:11434 NewThe client could not reach the Ollama server. Either the service is not running, or it is running but bound to…
- Ollama: model not foundThe requested model has not been pulled/downloaded locally. Ollama requires models to be downloaded before use.
- Ollama: model requires more system memory than is available NewThe requested model does not fit in available VRAM or system RAM at the chosen quantisation and context length. Ollama…
- OpenAI API: 429 rate limit exceededRequests exceed your organisation or model rate limits. Returns 429 with retry headers.
- OpenAI API: context_length_exceededPrompt + response tokens exceed model's context window. Model refuses to generate.
- OpenAI Whisper: Maximum content size limit exceeded NewThe transcription endpoint caps uploads at 25 MB. Long recordings have to be split, and because a naive split cuts mid…
- OpenAI: 429 insufficient_quotaThe account has no remaining credits or has hit its billing quota. This is different from temporary rate limiting.
- OpenAI: Incorrect API key providedThe API key used in the request is invalid, expired, or revoked. May also occur if the key is from a different…
- OpenAI: model_not_found / model has been deprecated NewThe model id in the request does not exist for this account. Either the name is misspelled, the model was retired, or…
- OpenAI: Unsupported parameter: 'max_tokens' is not supported with this model NewNewer OpenAI models reject max_tokens and expect max_completion_tokens, because reasoning tokens are billed and…
- pgvector: expected N dimensions, not MA vector being inserted or queried does not match the fixed dimension declared on the vector column.
- PyTorch: CUDA out of memoryGPU memory exhausted when trying to allocate tensors. Common when model batch size is too large or previous tensors…
- PyTorch: Expected all tensors to be on the same device NewAn operation received one tensor on the GPU and another on the CPU. Moving the model with .to(device) does not move…
- RAG: embedding dimension mismatchVectors written with one embedding model do not match the index/column dimension, so inserts or similarity queries…
- TensorFlow: Could not find GPUTensorFlow cannot detect any GPU devices. CUDA, cuDNN, or GPU drivers may not be installed or are incompatible.
- Transformers: this model requires trust_remote_code=True NewThe model repository ships custom modelling code that Transformers will not execute without explicit consent. Enabling…
- vLLM: KV cache out of memoryThe vLLM inference server ran out of GPU memory for the key-value cache, which stores attention states for concurrent…
Other categories
- Ansible 10Unreachable hosts, become passwords, undefined variables and Jinja2 failures.
- API 14Auth headers, payload limits, versioning, idempotency and webhook signatures.
- Apple 10Command line tools, dyld, Homebrew permissions, notarisation and Keychain.
- Auth 11OIDC, SAML, Auth0, Okta, Keycloak, passkeys and MFA failures.
- BigData 11Spark, Kafka, Airflow, Snowflake, Flink and Databricks failures.
- C# 12NuGet restore, null references, EF Core migrations, async deadlocks and Blazor…
- C++ 11Segfaults, linker errors, memory corruption and template deduction failures.
- Caching 10Cache stampedes, stale content, Varnish and CloudFront failures.
- CI/CD 18GitHub Actions, GitLab CI, Jenkins, CircleCI: permissions, runners and…
- Client 21CORS, mixed content, module resolution, memory limits and framework runtime…
- Cloud 25IAM permissions, quotas, service limits and credential failures.
- Dart 10Null safety, pub version solving and build toolchain problems.
- Database 41Connections, deadlocks, constraints, replication and memory limits.
- DNS 10NXDOMAIN, SERVFAIL, timeouts, propagation and delegation problems.
- Docker 27Daemon connectivity, disk space, image pulls, ports and architecture mismatches.
- Elixir 9GenServer timeouts, supervision failures and Mix compilation problems.
- Email 8Delivery failures, relay denial, authentication, SPF, DKIM and DMARC.
- Frontend 23Hydration mismatches, bundler resolution, layout shift and font loading.
- Git 20Merge conflicts, rejected pushes, detached HEAD, LFS and repository corruption.
- Go 19Nil map assignment, concurrent map access, context cancellation and deadlocks.
- GraphQL 13Validation, depth limits, N+1 queries and fragment problems.
- gRPC 10Status codes, deadlines, message limits, TLS and HTTP/2 transport failures.
- HTTP 494xx client errors, 5xx server errors, redirects, headers and protocol problems.
- ICMP 23Destination unreachable, time exceeded, fragmentation needed and redirects.
- Ingress 8404 default backend, missing TLS secrets, IngressClass and path matching.
- Java 19Class loading, dependency resolution, connection pools and JVM version…
- JavaScript 42npm resolution, async pitfalls, hydration, memory limits and runtime type…
- Kubernetes 34CrashLoopBackOff, ImagePullBackOff, OOMKilled, RBAC, scheduling and storage.
- Logging 9Log4j, Logback, Fluentd, Logstash and CloudWatch ingestion problems.
- MessageQueue 14Kafka, RabbitMQ, SQS, NATS and Celery: lag, rebalancing and poison messages.
- Mobile 17Gradle, CocoaPods, Xcode signing, Metro bundler and toolchain mismatches.
- Monitoring 12Prometheus scrapes, Grafana data sources, OpenTelemetry exporters and agent…
- Network 35Refused connections, timeouts, resets, MTU problems and port exhaustion.
- Performance 6GC pauses, thread pool starvation and event loop blocking.
- PHP 11Memory limits, execution timeouts, autoloading, Composer and PDO connections.
- Proxy 17nginx, Envoy, HAProxy, Traefik, Caddy and Cloudflare upstream failures.
- Python 35Imports, virtual environments, encoding, concurrency and dependency conflicts.
- Regex 8Catastrophic backtracking, back references, escaping and engine differences.
- Ruby 11Bundler, migrations, native extensions, encoding and asset compilation.
- Rust 19Borrow checker, ownership moves, trait bounds and lifetime mismatches.
- Scala 6Dependency resolution, binary compatibility and type inference failures.
- Security 25JWT validation, CSRF, OAuth grants, SELinux, SSH host keys and CSP.
- Serverless 11Lambda timeouts, package size limits, VPC networking and cold starts.
- Shell 13Command not found, permissions, quoting, expansion and Makefile syntax.
- Storage 13S3 permissions, NFS mounts, quotas, signed URLs and volume attachment.
- Svelte 10Store subscriptions, load functions and server/client boundaries.
- System 26Disk space, systemd units, file descriptors, OOM killer and scheduled jobs.
- Terraform 18State locks, provider auth, drift, dependency cycles and plan-time unknowns.
- Testing 18Jest, pytest, JUnit, Cypress and Playwright: fixtures, snapshots and timeouts.
- TLS 24Untrusted authorities, expiry, hostname mismatch, chains and cipher negotiation.
- TypeScript 19Assignability, missing declarations, strict null checks and generic constraints.
- Virtualization 8VirtualBox, VMware, Hyper-V, WSL, KVM and hypervisor conflicts.
- Web3 7Gas estimation, nonce management and reverted transactions.
- WebAssembly 7Compile errors, memory bounds and host binding mismatches.
- WebServer 10nginx, Apache, IIS and Caddy: binding, permissions, rewrites and TLS.
- Windows 10Installer failures, missing runtimes, update errors and permission problems.