{"record":{"id":"a2fc581dfda2c64f","repo":"BerriAI/litellm","slug":"oci-serving-mode-must-be-on-demand-or-dedicated","errorCode":null,"errorMessage":"oci_serving_mode must be 'ON_DEMAND' or 'DEDICATED'.","messagePattern":"oci_serving_mode must be 'ON_DEMAND' or 'DEDICATED'\\.","errorType":"exception","errorClass":"OCIError","httpStatus":400,"severity":"error","filePath":"litellm/llms/oci/embed/transformation.py","lineNumber":222,"sourceCode":"                            \"Convert token lists to strings before calling embedding().\"\n                        ),\n                    )\n                texts.append(item if isinstance(item, str) else str(item))\n        else:\n            texts = [str(input)]\n\n        if len(texts) > OCI_EMBED_BATCH_LIMIT:\n            raise OCIError(\n                status_code=400,\n                message=(\n                    f\"OCI embedText accepts at most {OCI_EMBED_BATCH_LIMIT} inputs per request \"\n                    f\"(got {len(texts)}). Batch your requests.\"\n                ),\n            )\n\n        serving_mode_type: Final = optional_params.get(\"oci_serving_mode\", \"ON_DEMAND\").upper()\n        if serving_mode_type not in {\"ON_DEMAND\", \"DEDICATED\"}:\n            raise OCIError(\n                status_code=400,\n                message=\"oci_serving_mode must be 'ON_DEMAND' or 'DEDICATED'.\",\n            )\n\n        if serving_mode_type == \"DEDICATED\":\n            endpoint_id: Final = optional_params.get(\"oci_endpoint_id\", model)\n            serving_mode = OCIServingMode(servingType=\"DEDICATED\", endpointId=endpoint_id)\n        else:\n            serving_mode = OCIServingMode(servingType=\"ON_DEMAND\", modelId=model)\n\n        # Map input_type from OpenAI convention to OCI/Cohere convention\n        input_type = optional_params.get(\"input_type\")\n        if input_type:\n            input_type = _INPUT_TYPE_MAP.get(input_type.lower(), input_type.upper())\n\n        request: Final = OCIEmbedRequest(\n            compartmentId=compartment_id,\n            servingMode=serving_mode,","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/oci/embed/transformation.py#L204-L240","documentation":"Error \"oci_serving_mode must be 'ON_DEMAND' or 'DEDICATED'.\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/oci/embed/transformation.py:222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set oci_serving_mode to 'ON_DEMAND' or 'DEDICATED'."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}