Repository: camel-ai/camel
Pull request #2304: feat:add deepseek prover v2 671B in ppio
Author: login: zjrwtx
Created: 2025-05-01T03:20:16Z | Merged: 2025-05-01T19:36:16Z

## Description

close https://github.com/camel-ai/camel/issues/2303
## Checklist

Go over all the following points, and put an `x` in all the boxes that apply.

- [ ] I have read the [CONTRIBUTION](https://github.com/camel-ai/camel/blob/master/CONTRIBUTING.md) guide (**required**)
- [ ] I have linked this PR to an issue using the Development section on the right sidebar or by adding `Fixes #issue-number` in the PR description (**required**)
- [ ] I have checked if any dependencies need to be added or updated in `pyproject.toml` and `uv lock`
- [ ] I have updated the tests accordingly (*required for a bug fix or a new feature*)
- [ ] I have updated the documentation if needed:
- [ ] I have added examples if this is a new feature

If you are unsure about any of these, don't hesitate to ask. We are here to help!



Diff:
diff --git a/camel/types/enums.py b/camel/types/enums.py
index e37b619650..9c3679858e 100644
--- a/camel/types/enums.py
+++ b/camel/types/enums.py
@@ -105,6 +105,7 @@ class ModelType(UnifiedModelType, Enum):
     TOGETHER_LLAMA_4_SCOUT = "meta-llama/Llama-4-Scout-17B-16E-Instruct"
 
     # PPIO platform models support tool calling
+    PPIO_DEEPSEEK_PROVER_V2_671B = "deepseek/deepseek-prover-v2-671b"
     PPIO_DEEPSEEK_R1_TURBO = "deepseek/deepseek-r1-turbo"
     PPIO_DEEPSEEK_V3_TURBO = "deepseek/deepseek-v3-turbo"
     PPIO_DEEPSEEK_R1_COMMUNITY = "deepseek/deepseek-r1/community"
@@ -716,6 +717,7 @@ def is_netmind(self) -> bool:
     @property
     def is_ppio(self) -> bool:
         return self in {
+            ModelType.PPIO_DEEPSEEK_PROVER_V2_671B,
             ModelType.PPIO_DEEPSEEK_R1_TURBO,
             ModelType.PPIO_DEEPSEEK_V3_TURBO,
             ModelType.PPIO_DEEPSEEK_R1_COMMUNITY,
@@ -928,6 +930,7 @@ def token_limit(self) -> int:
         }:
             return 14_336
         elif self in {
+            ModelType.PPIO_DEEPSEEK_PROVER_V2_671B,
             ModelType.NOVITA_DOLPHIN_MIXTRAL_8X22B,
         }:
             return 16_000
diff --git a/examples/models/ppio_model_example.py b/examples/models/ppio_model_example.py
index bddd665acd..87718195d8 100644
--- a/examples/models/ppio_model_example.py
+++ b/examples/models/ppio_model_example.py
@@ -17,7 +17,13 @@
 from camel.models import ModelFactory
 from camel.types import ModelPlatformType, ModelType
 
-model = ModelFactory.create(
+"""
+please set the below os environment:
+export PPIO_API_KEY=""
+"""
+
+# deepseek r1
+model_R1 = ModelFactory.create(
     model_platform=ModelPlatformType.PPIO,
     model_type=ModelType.PPIO_DEEPSEEK_R1,
     model_config_dict=PPIOConfig(temperature=0.2).as_dict(),
@@ -27,7 +33,7 @@
 sys_msg = "You are a helpful assistant."
 
 # Set agent
-camel_agent = ChatAgent(system_message=sys_msg, model=model)
+camel_agent = ChatAgent(system_message=sys_msg, model=model_R1)
 
 user_msg = """Say hi to CAMEL AI, one open-source community 
     dedicated to the study of autonomous and communicative agents."""
@@ -56,3 +62,100 @@
 driving open, creative research.
 ===============================================================================
 '''
+
+# deepseek prover v2 671b
+model_prover = ModelFactory.create(
+    model_platform=ModelPlatformType.PPIO,
+    model_type=ModelType.PPIO_DEEPSEEK_PROVER_V2_671B,
+    model_config_dict=PPIOConfig(temperature=0.2).as_dict(),
+)
+
+# Define system message
+sys_msg = "You are an exceptionally skilled mathematics professor in teaching."
+
+# Set agent
+camel_agent = ChatAgent(system_message=sys_msg, model=model_prover)
+
+user_msg = """Find the sum of all integer bases $ b > 9 $ for which $ 17_b $ is a divisor of $ 97_b $."""
+
+# Get response information
+response = camel_agent.step(user_msg)
+print(response.msgs[0].content)
+
+# ruff: noqa: E501
+'''
+===============================================================================
+First, we need to understand what the notation $ 17_b $ and $ 97_b $ means. The subscript $ b $ indicates that the number is in base $ b $. 
+
+1. **Convert $ 17_b $ to base 10:**
+   \[
+   17_b = 1 \cdot b + 7 = b + 7
+   \]
+
+2. **Convert $ 97_b $ to base 10:**
+   \[
+   97_b = 9 \cdot b + 7 = 9b + 7
+   \]
+
+The problem states that $ 17_b $ divides $ 97_b $ in base 10, i.e., $ b + 7 $ divides $ 9b + 7 $.
+
+### Step 1: Set up the divisibility condition
+We can write the divisibility condition as:
+\[
+b + 7 \mid 9b + 7
+\]
+
+### Step 2: Perform polynomial division or find a relationship
+We can express $ 9b + 7 $ in terms of $ b + 7 $:
+\[
+9b + 7 = 9(b + 7) - 56
+\]
+This means:
+\[
+b + 7 \mid 9(b + 7) - 56 \implies b + 7 \mid 56
+\]
+because $ b + 7 $ divides $ 9(b + 7) $.
+
+### Step 3: Find all divisors of 56
+The positive divisors of 56 are:
+\[
+1, 2, 4, 7, 8, 14, 28, 56
+\]
+
+Since $ b > 9 $ and $ b $ is an integer, $ b + 7 > 16 $. The corresponding values of $ b + 7 $ that are divisors of 56 and satisfy $ b + 7 > 16 $ are:
+\[
+28, 56
+\]
+
+### Step 4: Solve for $ b $
+1. For $ b + 7 = 28 $:
+   \[
+   b = 21
+   \]
+2. For $ b + 7 = 56 $:
+   \[
+   b = 49
+   \]
+
+### Step 5: Verify the solutions
+1. For $ b = 21 $:
+   - $ 17_{21} = 21 + 7 = 28 $
+   - $ 97_{21} = 9 \cdot 21 + 7 = 189 + 7 = 196 $
+   - Check if $ 28 \mid 196 $: $ 196 / 28 = 7 $, which is true.
+2. For $ b = 49 $:
+   - $ 17_{49} = 49 + 7 = 56 $
+   - $ 97_{49} = 9 \cdot 49 + 7 = 441 + 7 = 448 $
+   - Check if $ 56 \mid 448 $: $ 448 / 56 = 8 $, which is true.
+
+Both values of $ b $ are valid.
+
+### Step 6: Sum the valid bases
+The valid bases are $ 21 $ and $ 49 $. Their sum is:
+\[
+21 + 49 = 70
+\]
+
+### Final Answer
+\boxed{70}
+===============================================================================
+'''


Reviews:
user: login: Wendong-Fan
body: thanks @zjrwtx , for the example code let's use deepseek's official service
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-05-01T09:57:21Z
user: login: MuggleJinx
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-05-01T15:54:52Z
user: login: Wendong-Fan
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-01T19:35:33Z

Review comments:
diff_hunk: @@ -56,3 +62,99 @@
 driving open, creative research.
 ===============================================================================
 '''
+
+# deepseek prover v2 671b
+model_prover = ModelFactory.create(
+    model_platform=ModelPlatformType.PPIO,
+    model_type=ModelType.PPIO_DEEPSEEK_PROVER_V2_671B,
+    model_config_dict=PPIOConfig(temperature=0.2).as_dict(),
+)
+
+# Define system message
+sys_msg = "You are an exceptionally skilled mathematics professor in teaching."
+
+# Set agent
+camel_agent = ChatAgent(system_message=sys_msg, model=model_prover)
+
+user_msg = """Find the sum of all integer bases $ b > 9 $ for which $ 17_b $ is a divisor of $ 97_b $."""
+
+# Get response information
+response = camel_agent.step(user_msg)
+print(response.msgs[0].content)
+
+# ruff: noqa: E501
+'''
+First, we need to understand what the notation $ 17_b $ and $ 97_b $ means. The subscript $ b $ indicates that the number is in base $ b $. 
path: examples/models/ppio_model_example.py
user: login: Wendong-Fan
body: ```suggestion
'''
===============================================================================
First, we need to understand what the notation $ 17_b $ and $ 97_b $ means. The subscript $ b $ indicates that the number is in base $ b $. 
```
created_at: 2025-05-01T19:35:21Z
author_association: MEMBER
diff_hunk: @@ -56,3 +62,99 @@
 driving open, creative research.
 ===============================================================================
 '''
+
+# deepseek prover v2 671b
+model_prover = ModelFactory.create(
+    model_platform=ModelPlatformType.PPIO,
+    model_type=ModelType.PPIO_DEEPSEEK_PROVER_V2_671B,
+    model_config_dict=PPIOConfig(temperature=0.2).as_dict(),
+)
+
+# Define system message
+sys_msg = "You are an exceptionally skilled mathematics professor in teaching."
+
+# Set agent
+camel_agent = ChatAgent(system_message=sys_msg, model=model_prover)
+
+user_msg = """Find the sum of all integer bases $ b > 9 $ for which $ 17_b $ is a divisor of $ 97_b $."""
+
+# Get response information
+response = camel_agent.step(user_msg)
+print(response.msgs[0].content)
+
+# ruff: noqa: E501
+'''
+First, we need to understand what the notation $ 17_b $ and $ 97_b $ means. The subscript $ b $ indicates that the number is in base $ b $. 
+
+1. **Convert $ 17_b $ to base 10:**
+   \[
+   17_b = 1 \cdot b + 7 = b + 7
+   \]
+
+2. **Convert $ 97_b $ to base 10:**
+   \[
+   97_b = 9 \cdot b + 7 = 9b + 7
+   \]
+
+The problem states that $ 17_b $ divides $ 97_b $ in base 10, i.e., $ b + 7 $ divides $ 9b + 7 $.
+
+### Step 1: Set up the divisibility condition
+We can write the divisibility condition as:
+\[
+b + 7 \mid 9b + 7
+\]
+
+### Step 2: Perform polynomial division or find a relationship
+We can express $ 9b + 7 $ in terms of $ b + 7 $:
+\[
+9b + 7 = 9(b + 7) - 56
+\]
+This means:
+\[
+b + 7 \mid 9(b + 7) - 56 \implies b + 7 \mid 56
+\]
+because $ b + 7 $ divides $ 9(b + 7) $.
+
+### Step 3: Find all divisors of 56
+The positive divisors of 56 are:
+\[
+1, 2, 4, 7, 8, 14, 28, 56
+\]
+
+Since $ b > 9 $ and $ b $ is an integer, $ b + 7 > 16 $. The corresponding values of $ b + 7 $ that are divisors of 56 and satisfy $ b + 7 > 16 $ are:
+\[
+28, 56
+\]
+
+### Step 4: Solve for $ b $
+1. For $ b + 7 = 28 $:
+   \[
+   b = 21
+   \]
+2. For $ b + 7 = 56 $:
+   \[
+   b = 49
+   \]
+
+### Step 5: Verify the solutions
+1. For $ b = 21 $:
+   - $ 17_{21} = 21 + 7 = 28 $
+   - $ 97_{21} = 9 \cdot 21 + 7 = 189 + 7 = 196 $
+   - Check if $ 28 \mid 196 $: $ 196 / 28 = 7 $, which is true.
+2. For $ b = 49 $:
+   - $ 17_{49} = 49 + 7 = 56 $
+   - $ 97_{49} = 9 \cdot 49 + 7 = 441 + 7 = 448 $
+   - Check if $ 56 \mid 448 $: $ 448 / 56 = 8 $, which is true.
+
+Both values of $ b $ are valid.
+
+### Step 6: Sum the valid bases
+The valid bases are $ 21 $ and $ 49 $. Their sum is:
+\[
+21 + 49 = 70
+\]
+
+### Final Answer
+\boxed{70}
+
+'''
path: examples/models/ppio_model_example.py
user: login: Wendong-Fan
body: ```suggestion
\boxed{70}
===============================================================================
'''
```
created_at: 2025-05-01T19:35:29Z
author_association: MEMBER

PR comments:
user: login: zjrwtx
created_at: 2025-05-01T12:06:01Z
body: > thanks @zjrwtx , for the example code let's use deepseek's official service

hey @Wendong-Fan ，deepseek hasnt released this model api,so should i just delete the example file?
author_association: COLLABORATOR
user: login: Wendong-Fan
created_at: 2025-05-01T12:39:33Z
body: > > thanks @zjrwtx , for the example code let's use deepseek's official service
> 
> hey @Wendong-Fan ，deepseek hasnt released this model api,so should i just delete the example file?

maybe we can add the example code under `examples/models/ppio_model_example.py`
author_association: MEMBER
user: login: zjrwtx
created_at: 2025-05-01T15:54:40Z
body: > > > thanks @zjrwtx , for the example code let's use deepseek's official service
> > 
> > 
> > hey @Wendong-Fan ，deepseek hasnt released this model api,so should i just delete the example file?
> 
> maybe we can add the example code under `examples/models/ppio_model_example.py`

thanks @Wendong-Fan ，changed it ,please let me know your thought
author_association: COLLABORATOR