{"record":{"id":"e26e2365726aacf3","repo":"continuedev/continue","slug":"unsupported-model-body-model","errorCode":null,"errorMessage":"Unsupported model: ${body.model}","messagePattern":"Unsupported model: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/Bedrock.ts","lineNumber":654,"sourceCode":"        truncate: \"END\",\n      };\n      const output = await this.getInvokeModelResponseBody(body.model, payload);\n      embeddings = [output.embedding];\n    } else if (body.model.startsWith(\"amazon.titan-embed\")) {\n      embeddings = await Promise.all(\n        texts.map(async (text) => {\n          const payload = {\n            inputText: text,\n          };\n          const output = await this.getInvokeModelResponseBody(\n            body.model,\n            payload,\n          );\n          return output.embeddings || [];\n        }),\n      );\n    } else {\n      throw new Error(`Unsupported model: ${body.model}`);\n    }\n\n    return embedding({\n      data: embeddings,\n      model: body.model,\n      usage: {\n        prompt_tokens: 0,\n        total_tokens: 0,\n      },\n    });\n  }\n\n  async rerank(body: RerankCreateParams): Promise<CreateRerankResponse> {\n    if (!body.query || !body.documents.length) {\n      throw new Error(\"Query and chunks must not be empty\");\n    }\n\n    // Base payload for both models","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/Bedrock.ts#L636-L672","documentation":"The embed method dispatches by model family: only known Bedrock embedding models (e.g. Amazon Titan / Cohere embed models the adapter recognizes) are handled; any other model string falls into the else branch and throws `Unsupported model: <model>`. It is a whitelist-based capability gate, not an AWS-side rejection.","triggerScenarios":"Calling embed with a chat model id (e.g. 'anthropic.claude-3-sonnet') or an embedding model id not in the adapter's recognized list; using a newer Bedrock embedding model released after the adapter version in use; passing an OpenAI model name like 'text-embedding-3-small' unmodified.","commonSituations":"Multi-provider configs reusing OpenAI model names; new Bedrock embedding models not yet supported by the installed adapter version; typos in model identifiers.","solutions":["Check the supported embedding model list for your adapter version and use one of those exact ids (e.g. amazon.titan-embed-text-v2:0).","Upgrade the openai-adapters package — new Bedrock embedding models get added over time.","Verify the model string isn't accidentally an OpenAI name or a chat model; strip provider prefixes the adapter doesn't expect."],"exampleFix":"// before\nawait api.embed({ model: 'text-embedding-3-small', input: ['hi'] });\n\n// after\nawait api.embed({ model: 'bedrock/amazon.titan-embed-text-v2:0', input: ['hi'] });","handlingStrategy":"validation","validationCode":"const SUPPORTED_BEDROCK_EMBED_MODELS = [/^amazon\\.titan-embed/, /^cohere\\.embed/];\nconst isSupportedEmbedModel = (m: string) => SUPPORTED_BEDROCK_EMBED_MODELS.some(r => r.test(m));\nif (!isSupportedEmbedModel(body.model)) throw new Error(`Unsupported embedding model: ${body.model}`);","typeGuard":null,"tryCatchPattern":"try {\n  await api.embed(body);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unsupported model:')) {\n    // switch to a supported embedding model or another provider\n  }\n  throw e;\n}","preventionTips":["Keep an allow-list of Bedrock embedding model IDs and validate before calling.","Upgrade openai-adapters when new Bedrock embedding models launch.","Never reuse OpenAI embedding model names with the Bedrock adapter."],"tags":["bedrock","embeddings","model-not-supported","whitelist"],"backgroundTag":"unsupported-model","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}