Fixes
AI and LLM integration
Rate limits, quota errors, broken JSON output, cost and latency when you add LLM features from OpenAI or Anthropic to a production app.

41 fixes
Problems in this area
41 of 41 fixes
- Azure OpenAI says the API deployment for this resource does not exist
The API deployment for this resource does not exist2 causes - Azure OpenAI fails with an SSL certificate verification error
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED]2 causes - Amazon Bedrock refuses a Claude model ID with on-demand throughput
Invocation of model ID ... with on-demand throughput isn't supported3 causes - Chroma data is empty after a restart in LangChain
similarity_search returns an empty list on the second run3 causes - LangChain says it could not import the chromadb package
ImportError: Could not import chromadb python package. Please install it with `pip install chromadb`.2 causes - Gemini API returns 429 RESOURCE_EXHAUSTED on the free tier
429 RESOURCE_EXHAUSTED3 causes - Gemini API says the model is not found for gemini-1.5-pro or gemini-1.5-flash
Model not found when using gemini 1.53 causes - ChatPromptTemplate is missing the variable agent_scratchpad
Input to ChatPromptTemplate is missing variables {'agent_scratchpad'}2 causes - LangChain no longer exports AgentExecutor from langchain.agents
ImportError: cannot import name 'AgentExecutor' from 'langchain.agents'2 causes - ConversationalRetrievalChain cannot be imported from langchain.chains
ImportError: cannot import name 'ConversationalRetrievalChain' from 'langchain.chains'2 causes - LangChain warns that importing document loaders from langchain is deprecated
LangChainDeprecationWarning: Importing document loaders from langchain is deprecated.2 causes - ModuleNotFoundError for langchain.chains, or RetrievalQA that will not import
ModuleNotFoundError: No module named 'langchain.chains'2 causes - LangChain OutputParserException because the model did not return valid JSON
langchain_core.exceptions.OutputParserException: Invalid json output:3 causes - RecursiveCharacterTextSplitter is missing after a LangChain upgrade
ImportError: cannot import name 'RecursiveCharacterTextSplitter' from 'langchain'2 causes - TextLoader fails on a text file with an encoding error
RuntimeError: Error loading notes.txt3 causes - LlamaIndex cannot find LangchainEmbedding in the llama_index package
ImportError: cannot import name 'LangchainEmbedding' from 'llama_index'2 causes - LlamaIndex cannot import Ollama from llama_index.llms
ImportError: cannot import name 'Ollama' from 'llama_index.llms' (unknown location)3 causes - LlamaIndex gets 404 Not Found from Ollama at /api/chat
Client error '404 Not Found' for url 'http://localhost:11434/api/chat'2 causes - The model's reply breaks JSON.parse
SyntaxError: Unexpected token '`', "```json ..." is not valid JSON5 causes - An MCP server fails during initialization from a LangChain client
Unsupported protocol version4 causes - The OpenAI Node client in Next.js cannot find OPENAI_API_KEY
The OPENAI_API_KEY environment variable is missing or empty3 causes - The shell says ollama: command not found
/bin/bash: line 1: ollama: command not found2 causes - ollama Python library fails with httpx.ConnectError
httpx.ConnectError3 causes - Ollama is slow and the GPU is not being used
ollama ps shows 100% CPU or a split such as 48%/52% CPU/GPU4 causes - Open WebUI or another Docker app cannot connect to Ollama
[Errno 111] Connection refused3 causes - Open WebUI web search with SearXNG fails with 403
403 Client Error: Forbidden2 causes - The OpenAI API answers 429: out of credit, or just too fast?
429 Rate limit reached for requests5 causes - The OpenAI client says the API key is missing
Missing credentials. Please pass an `api_key`3 causes - OpenAI says the model is a chat model and not supported in the v1/completions endpoint
This is a chat model and not supported in the v1/completions endpoint3 causes - Old openai.ChatCompletion or openai.Embedding code breaks on a new SDK
You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.02 causes - TypeError when you index an OpenAI response like a dictionary
TypeError: 'ChatCompletion' object is not subscriptable2 causes - TypeError: Client.__init__() got an unexpected keyword argument 'proxies'
TypeError: Client.__init__() got an unexpected keyword argument 'proxies'2 causes - OpenAI API 400: image_url is only supported by certain models
BadRequestError: 400 Invalid content type. image_url is only supported by certain models.2 causes - OpenAI rejects response_format json_schema for the model you chose
Invalid parameter: 'response_format' of type 'json_schema' is not supported with model version `gpt-4-turbo`2 causes - ModuleNotFoundError for openai.embeddings_utils
ModuleNotFoundError: No module named 'openai.embeddings_utils'2 causes - pymilvus times out connecting to Milvus on localhost:19530 from a container
MilvusException: (code=2, message=Fail connecting to server on localhost:19530. Timeout)2 causes - ImportError: cannot import name 'OpenAI' from partially initialized module 'openai'
ImportError: cannot import name 'OpenAI' from partially initialized module 'openai' (most likely due to a circular import)2 causes - RetrievalQA raises ValueError: Missing some input keys
ValueError: Missing some input keys: {'query'}2 causes - SafetensorError: Error while deserializing header: HeaderTooLarge
safetensors_rust.SafetensorError: Error while deserializing header: HeaderTooLarge2 causes - from_pretrained cannot find model.safetensors in the directory
OSError: Error no file named model.safetensors found in directory3 causes - Whisper prints "FP16 is not supported on CPU; using FP32 instead"
FP16 is not supported on CPU; using FP32 instead2 causes
Next step
Something here keeps breaking?
I fix these for clients and run the same stack in production myself.