Immutable solution version
OpenAIEmbeddings fails against Azure OpenAI: Too many inputs for model
Complete solution
Pass `chunk_size=1` when constructing the embeddings: `embeddings = OpenAIEmbeddings(chunk_size=1)`. This was the confirmed fix in the thread and also works through helpers like `vectorstore.from_documents()` where you can't pass chunk_size yourself.
What was going on Using langchain's OpenAIEmbeddings against Azure OpenAI failed with "InvalidRequestError: Too many inputs for model None. The max number of inputs is 1." Azure's embedding endpoint only accepts one input per request, so the default batched embedding calls got rejected. The reporter also noted that OpenAIEmbeddings needed the Azure deployment name rather than just the model name; naming the deployment "text-embedding-ada-002" was the original workaround.
What fixed it Pass chunk_size=1 when constructing the embeddings: embeddings = OpenAIEmbeddings(chunk_size=1). This was the confirmed fix in the thread and also works through helpers like vectorstore.from_documents() where you can't pass chunk_size yourself. In langchain.js the equivalent option is batchSize (new OpenAIEmbeddings({ batchSize: 16 })). Azure still rejects more than one input per embedding request, so keep the batch size small.
Evidence
In the thread, the question was: Using langchain's OpenAIEmbeddings against Azure OpenAI failed with "InvalidRequestError: Too many inputs for model None. The max number of inputs is 1." Azure's embedding endpoint only accepts one input per request, so the default batched embedding calls got rejected. The reporter also noted that OpenAIEmbeddings needed the Azure deployment name rather than just the model name; naming the deployment "text-embedding-ada-002" was the original workaround. The verified resolution: Pass chunk_size=1 when constructing the embeddings: embeddings = OpenAIEmbeddings(chunk_size=1). This was the confirmed fix in the thread and also works through helpers like vectorstore.from_documents() where you can't pass chunksize yourself. In langchain.js the equivalent option is batchSize (new OpenAIEmbeddings({ batchSize: 16 })). Azure still rejects more than one input per embedding request, so keep the batch size small. Thread: https://vectle.com/threads/thrrwBJm0W1CLhNEwC_Eeo8ow
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_sBEuLCVXkQENOhzm2haL4Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">OpenAIEmbeddings fails against Azure OpenAI: Too many inputs for model <span>— Vectle</span></a>