Skip to content

[Bug]: AWS Bedrock Deepseek R1 base model issue #9161

Closed
@forpr1093

Description

@forpr1093

What happened?

I am encountering an issue when attempting to retrieve responses from the AWS Bedrock DeepSeek R1 base model using LiteLLM. Debugging via LiteLLM shows LLM provider not provided, leading to the following error:

"cannot unpack non-iterable NoneType object"

What I Have Tried:

Passing different model identifiers:
bedrock/deepseek.r1-v1:0
bedrock/us.deepseek.r1-v1:0
bedrock/deepseek_r1/deepseek.r1-v1:0

Despite these attempts, the issue persists.

Expected Behavior:
LiteLLM should successfully parse the generated response from AWS Bedrock DeepSeek R1 without errors.

Environment Details:
Python version: 3.13.2
Operating System: Windows

Steps to Reproduce:

Call LiteLLM completion method with Deepseek R1 model id.

Relevant log output

LiteLLM: Params passed to completion() {'model': 'deepseek_r1/us.deepseek.r1-v1:0', 'functions': None, 'function_call': None, 'temperature': 0.0, 'top_p': None, 'n': None, 'stream': None, 'stream_options': None, 'stop': None, 'max_tokens': None, 'max_completion_tokens': None, 'modalities': None, 'prediction': None, 'audio': None, 'presence_penalty': None, 'frequency_penalty': None, 'logit_bias': None, 'user': None, 'custom_llm_provider': 'bedrock', 'response_format': None, 'seed': None, 'tools': None, 'tool_choice': 'auto', 'max_retries': None, 'logprobs': None, 'top_logprobs': None, 'extra_headers': None, 'api_version': None, 'parallel_tool_calls': None, 'drop_params': True, 'reasoning_effort': None, 'additional_drop_params': None, 'messages': [{'role': 'system', 'content': 'You are a helful assistant'}, {'role': 'user', 'content': [{'type': 'text', 'text': "Document 2: The Health fits of Apples  \nApples are among the most widely consumed fruits globally, celebrated notlfor their \nsweet and crisp flavor but also for their numerous health benefits. Rich in essential \nnutrients, applestribute to overall well -being and disease prevention.  \nA medium -sized apple provides approximately 104 calories, 28 grams of \ncarbohydratesd 5 grams of dietary fiber. They are a good source of vitamin C, providing \nabout 10% of the Daily Vae, and contain smalaunts of potassium, vitamin K, and \ncopper. Apples are also rich in polyphenols, which antioxidants that contribute to their \nhealth benefits. ( Healthline ) \nOne of the most significant advantages of consuming apples is their high fiber content. \nThe soluble fiber in apples, particularly pectin, aids digtion by promoting rur bowel \nmovements and preventing constipation. This fiber also helps regulate blood sugar \nlevby slowing the absorption of sugar into the bloodstream, making apples a beneficial \nsnack individuals managing diabetes. ( Cleveland Clinic ) \nApplehe been linked to heart health due to their soluble fiber and antdant properties. \nRegular consumption can help lower cholesterol levels, reducing the risk of heart \ndiseashe polyphenols in apples, such as flavonoids, have been shown to lower blood \npressure and reduce the risk of stroke. ( Healline) \nWeight management is another area where apples can be beneficial. Their high fiber \nand water content promote a feeling of fullness, which can ce overall calorie intake. \nStudies have shown that individuals who include apps in their diet mayxrience weight \nloss and improved overall heal( Healthline ) \nThe antioxidants in apples also play a role in cancer prevention. Research suggests that \na di rich in fruits likales can reduce the risk of certain cancers, including lung, breast, \nand digestive tract cancers. The antdants combat oxidative stress, which ca n lead to \ncancer development. ( Healthline ) \nFurthermore, apples may support brain health. The antioxidant quercetin, found in \napple skins, has been linked to protecting brain cells from oxidative damage, potentially \nreducing the risk of neurodegenerative disorders like Alzheimer's disease. ( Healthline ) \nIncorporating apples into your daily diet is a simple and effective way to harness these \nhealth benefits. Whether eaten fresh, added to salads, or included in various recipes, \napples offer a delicious and nutritious option for maintaining and improving hea lth. \nExploring Popular Apple Varieties  \nApples are among the most cultivated and consumed fruits globally, with over 7,500 \nvarieties grown worldwide. Each variety offers a unique combination of flavor, texture, \nand culinary uses, catering to diverse palates and preferences. Understanding these differences can enhance one's appreciation and selection of apples for various \npurposes.  \nRed Delicious  \nDiscovered in Iowa in the 1870s, Red Delicious apples are easily recognizable by their \ndeep red color and distinctive shape. They have a mild, sweet flavor and a slightly mealy \ntexture. While they are often consumed fresh, their softness makes them less id eal for \nbaking.  \nMartha Stewart  \nGranny Smith  \nOriginating from Australia in the 1860s, Granny Smith apples are known for their bright \ngreen skin and tart flavor. They have a firm, crisp texture, making them excellent for \nbaking, cooking, and fresh consumption. Their high acidity adds a refreshing shar pness \nto salads and desserts.  \nHealth  \nHoneycrisp  \nDeveloped by the University of Minnesota and released in the 1990s, Honeycrisp apples \nhave quickly become a favorite due to their exceptional juiciness and balanced sweet -\ntart flavor. They possess a crisp, firm texture, making them ideal for fresh eating a nd \nsalads. Their popularity has led to widespread cultivation across apple -growing regions.  \nPick Your Own  \nGolden Delicious  \nDiscovered in West Virginia in the early 20th century, Golden Delicious apples are \ncharacterized by their yellow skin and sweet, mellow flavor. They have a tender, crisp \ntexture and are versatile in culinary applications, suitable for eating fresh, baking,  and \nmaking sauces. Their sweetness reduces the need for added sugar in recipes.  \nPick Your Own  \nFuji  \nDeveloped in Japan in the late 1930s, Fuji apples are a cross between Red Delicious and \nRalls Janet varieties. They are known for their dense, crisp flesh and high sugar content, \nresulting in a very sweet flavor. Fuji apples have a long shelf life and are excellent for \nfresh consumption, though they can also be used in baking and salads.  \nPick Your Own  \nGala  \nOriginating from New Zealand in the 1930s, Gala apples are a cross between Kidd's \nOrange Red and Golden Delicious. They have a reddish -orange skin with yellow \nundertones and a sweet, mild flavor. Their crisp yet tender texture makes them popular for snacking and salads. Gala apples have become one of the most widely grown \nvarieties globally.  \nPick Your Own  \nWhen selecting apples, consider their intended use —whether for fresh eating, baking, \nor cooking —to choose the most suitable variety. Exploring different types can lead to \ndelightful culinary experiences and a greater appreciation for this versatile fruit.  \n "}]}], 'thinking': None}

11:40:05 - LiteLLM:DEBUG: get_api_base.py:63 - Error occurred in getting api base - litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=deepseek_r1/us.deepseek.r1-v1:0
 Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers
2025-03-12 11:40:05,375 - DEBUG - Error occurred in getting api base - litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers
2025-03-12 11:40:05,375 - DEBUG - Error occurred in getting api base - litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=deepseek_r1/us.deepseek.r1-v1:0
 Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers
 you are trying to call. You passed model=deepseek_r1/us.deepseek.r1-v1:0
 Pass model as E.g. For 'Huggingface' inference endpoints pass in `completion(model='huggingface/starcoder',..)` Learn more: https://docs.litellm.ai/docs/providers

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

v1.63.6

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions