{"record":{"id":"99fddc9b2569bdb6","repo":"conductor-oss/conductor","slug":"unsupported-model-modelid","errorCode":null,"errorMessage":"Unsupported model {modelId}","messagePattern":"Unsupported model (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"ai/src/main/java/org/conductoross/conductor/ai/providers/bedrock/Bedrock.java","lineNumber":64,"sourceCode":"\n    public static final String NAME = \"bedrock\";\n    private final BedrockConfiguration config;\n\n    public Bedrock(BedrockConfiguration config) {\n        this.config = config;\n    }\n\n    @Override\n    public String getModelProvider() {\n        return NAME;\n    }\n\n    @SneakyThrows\n    @Override\n    public List<Float> generateEmbeddings(EmbeddingGenRequest embeddingGenRequest) {\n        String modelId = embeddingGenRequest.getModel();\n        if (!modelId.startsWith(\"cohere.\")) {\n            throw new RuntimeException(\"Unsupported model \" + modelId);\n        }\n        var client =\n                BedrockRuntimeClient.builder()\n                        .credentialsProvider(config.getAwsCredentialsProvider())\n                        .region(Region.of(config.getRegion()))\n                        .build();\n        Map<String, Object> requestMap =\n                getEmbeddingRequest(embeddingGenRequest.getModel(), embeddingGenRequest.getText());\n        byte[] body = om.writeValueAsBytes(requestMap);\n        InvokeModelRequest request =\n                InvokeModelRequest.builder()\n                        .modelId(modelId)\n                        .body(SdkBytes.fromByteArray(body))\n                        .build();\n        InvokeModelResponse response = client.invokeModel(request);\n        byte[] byteArray = response.body().asByteArray();\n        Map<String, Map<String, Object>> ressMap = om.readValue(byteArray, Map.class);\n        List<List<Float>> floats = (List<List<Float>>) ressMap.get(\"embeddings\").get(\"float\");","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/ai/src/main/java/org/conductoross/conductor/ai/providers/bedrock/Bedrock.java#L46-L82","documentation":"Bedrock.generateEmbeddings() validates the embedding model ID before making any AWS API call: it only accepts model IDs prefixed with 'cohere.' because the request body is hardcoded to Cohere's format (input_type, embedding_types, texts). Any other model ID — Amazon Titan, OpenAI, etc. — is rejected immediately. This is a deliberate design constraint, not a bug: the request body construction in getEmbeddingRequest() is Cohere-specific.","triggerScenarios":"Calling generateEmbeddings on a Bedrock provider with a model ID that does not start with 'cohere.', such as 'amazon.titan-embed-text-v2:0', 'amazon.titan-embed-g1-text-02', or any non-Cohere embedding model available on Bedrock.","commonSituations":"Assuming the Bedrock provider supports all embedding models listed in the AWS Bedrock model catalog. Copying a model ID from AWS documentation for Titan embeddings and using it with this provider. Workflow config referencing a Bedrock embedding model from a different family.","solutions":["Use a Cohere embedding model ID: 'cohere.embed-english-v3', 'cohere.embed-multilingual-v3', etc.","If you need Amazon Titan or another non-Cohere embedding model, extend the Bedrock provider to handle their request/response formats, or use a different provider that supports them.","Validate the model ID before calling generateEmbeddings if building a dynamic workflow."],"exampleFix":"// before\nString modelId = \"amazon.titan-embed-text-v2:0\";\nList<Float> embeddings = bedrock.generateEmbeddings(\n    new EmbeddingGenRequest(modelId, text, null));\n\n// after\nString modelId = \"cohere.embed-english-v3\";\nList<Float> embeddings = bedrock.generateEmbeddings(\n    new EmbeddingGenRequest(modelId, text, null));","handlingStrategy":"validation","validationCode":"// Validate model ID before calling Bedrock embeddings\nvoid validateBedrockEmbeddingModel(String modelId) {\n    if (modelId == null || !modelId.startsWith(\"cohere.\")) {\n        throw new IllegalArgumentException(\n            \"Bedrock embeddings only support Cohere models (prefix 'cohere.'). \"\n            + \"Got: \" + modelId + \". \"\n            + \"Valid: cohere.embed-english-v3, cohere.embed-multilingual-v3\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    return bedrock.generateEmbeddings(request);\n} catch (RuntimeException e) {\n    if (e.getMessage().startsWith(\"Unsupported model\")) {\n        throw new IllegalArgumentException(\n            \"Use a Cohere embedding model (cohere.*) for Bedrock. Got: \"\n            + request.getModel(), e);\n    }\n    throw e;\n}","preventionTips":["Always prefix Bedrock embedding model IDs with 'cohere.' — this provider only implements the Cohere request format.","Validate the model ID at workflow-definition time, not at runtime, to fail fast.","If you need Amazon Titan embeddings, either extend the Bedrock provider or use a different embedding source."],"tags":["bedrock","embeddings","unsupported-model","validation","cohere"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}