The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Merge branch 'litellm_contributor_prs_09_18_2025_p2' into fix/issue-14685-bedrock-titan-v2-encoding-format
Krish Dholakia63c26d7a4f46
diff --cc docs/my-website/docs/providers/bedrock.mdindex 749694bd89d,157a9e6a797..96148805b7a--- a/docs/my-website/docs/providers/bedrock.md+++ b/docs/my-website/docs/providers/bedrock.md@@@ -1821,59 -1821,7 +1821,60 @@@ Here's an example of using a bedrock mo| Mistral 7B Instruct | `completion(model='bedrock/mistral.mistral-7b-instruct-v0:2', messages=messages)` | `os.environ['AWS_ACCESS_KEY_ID']`, `os.environ['AWS_SECRET_ACCESS_KEY']`, `os.environ['AWS_REGION_NAME']` || Mixtral 8x7B Instruct | `completion(model='bedrock/mistral.mixtral-8x7b-instruct-v0:1', messages=messages)` | `os.environ['AWS_ACCESS_KEY_ID']`, `os.environ['AWS_SECRET_ACCESS_KEY']`, `os.environ['AWS_REGION_NAME']` |++## Bedrock Embedding++### API keys+This can be set as env variables or passed as **params to litellm.embedding()**+```python+import os+os.environ["AWS_ACCESS_KEY_ID"] = "" # Access key+os.environ["AWS_SECRET_ACCESS_KEY"] = "" # Secret access key+os.environ["AWS_REGION_NAME"] = "" # us-east-1, us-east-2, us-west-1, us-west-2+```++### Usage+```python+from litellm import embedding+response = embedding(+ model="bedrock/amazon.titan-embed-text-v1",+ input=["good morning from litellm"],+)+print(response)+```++#### Titan V2 - encoding_format support+```python+from litellm import embedding+# Float format (default)+response = embedding(+ model="bedrock/amazon.titan-embed-text-v2:0",+ input=["good morning from litellm"],+ encoding_format="float" # Returns float array+)++# Binary format+response = embedding(+ model="bedrock/amazon.titan-embed-text-v2:0",+ input=["good morning from litellm"],+ encoding_format="base64" # Returns base64 encoded binary+)+```++## Supported AWS Bedrock Embedding Models++| Model Name | Usage | Supported Additional OpenAI params |+|----------------------|---------------------------------------------|-----|+| Titan Embeddings V2 | `embedding(model="bedrock/amazon.titan-embed-text-v2:0", input=input)` | `dimensions`, `encoding_format` |+| Titan Embeddings - V1 | `embedding(model="bedrock/amazon.titan-embed-text-v1", input=input)` | [here](https://github.com/BerriAI/litellm/blob/f5905e100068e7a4d61441d7453d7cf5609c2121/litellm/llms/bedrock/embed/amazon_titan_g1_transformation.py#L53)+| Titan Multimodal Embeddings | `embedding(model="bedrock/amazon.titan-embed-image-v1", input=input)` | [here](https://github.com/BerriAI/litellm/blob/f5905e100068e7a4d61441d7453d7cf5609c2121/litellm/llms/bedrock/embed/amazon_titan_multimodal_transformation.py#L28) |+| Cohere Embeddings - English | `embedding(model="bedrock/cohere.embed-english-v3", input=input)` | [here](https://github.com/BerriAI/litellm/blob/f5905e100068e7a4d61441d7453d7cf5609c2121/litellm/llms/bedrock/embed/cohere_transformation.py#L18)+| Cohere Embeddings - Multilingual | `embedding(model="bedrock/cohere.embed-multilingual-v3", input=input)` | [here](https://github.com/BerriAI/litellm/blob/f5905e100068e7a4d61441d7453d7cf5609c2121/litellm/llms/bedrock/embed/cohere_transformation.py#L18)++### Advanced - [Drop Unsupported Params](https://docs.litellm.ai/docs/completion/drop_params#openai-proxy-usage)++### Advanced - [Pass model/provider-specific Params](https://docs.litellm.ai/docs/completion/provider_specific_params#proxy-usage)+## Image GenerationUse this for stable diffusion, and amazon nova canvas on bedrock