Skip to content

Commit 12dcc50

Browse files
committed
ADD benchmarks m2 max llama3
1 parent 3c90d2f commit 12dcc50

File tree

10 files changed

+31
-25
lines changed

10 files changed

+31
-25
lines changed

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The following sections will guide you through the installation process and the u
2121
:caption: Getting Started
2222

2323
getting_started/installation
24-
getting_started/examples
24+
getting_started/examples
2525
modules/modules
2626

2727
Indices and tables
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
OPENAI_APIKEY="your openai api key"
1+
OPENAI_APIKEY="your openai key here"

examples/benchmarks/GenerateScraper/Readme.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ The time is measured in seconds
99

1010
The model runned for this benchmark is Mistral on Ollama with nomic-embed-text
1111

12+
In particular, is tested with ScriptCreatorGraph
13+
1214
| Hardware | Model | Example 1 | Example 2 |
1315
| ---------------------- | --------------------------------------- | --------- | --------- |
1416
| Macbook 14' m1 pro | Mistral on Ollama with nomic-embed-text | 30.54s | 35.76s |
15-
| Macbook m2 max | Mistral on Ollama with nomic-embed-text | | |
16-
| Macbook 14' m1 pro<br> | Llama3 on Ollama with nomic-embed-text | 27.82s | 29.986s |
17-
| Macbook m2 max<br> | Llama3 on Ollama with nomic-embed-text | | |
17+
| Macbook m2 max | Mistral on Ollama with nomic-embed-text | 18,46s | 19.59 |
18+
| Macbook 14' m1 pro<br> | Llama3 on Ollama with nomic-embed-text | 27.82s | 29.98s |
19+
| Macbook m2 max<br> | Llama3 on Ollama with nomic-embed-text | 20.83s | 12.29s |
1820

1921

2022
**Note**: the examples on Docker are not runned on other devices than the Macbook because the performance are to slow (10 times slower than Ollama).
@@ -23,17 +25,17 @@ The model runned for this benchmark is Mistral on Ollama with nomic-embed-text
2325
**URL**: https://perinim.github.io/projects
2426
**Task**: List me all the projects with their description.
2527

26-
| Name | Execution time (seconds) | total_tokens | prompt_tokens | completion_tokens | successful_requests | total_cost_USD |
27-
| ------------------- | ------------------------ | ------------ | ------------- | ----------------- | ------------------- | -------------- |
28-
| gpt-3.5-turbo | 24.215268 | 1892 | 1802 | 90 | 1 | 0.002883 |
29-
| gpt-4-turbo-preview | 6.614 | 1936 | 1802 | 134 | 1 | 0.02204 |
28+
| Name | Execution time | total_tokens | prompt_tokens | completion_tokens | successful_requests | total_cost_USD |
29+
| ------------------- | ---------------| ------------ | ------------- | ----------------- | ------------------- | -------------- |
30+
| gpt-3.5-turbo | 4.50s | 1897 | 1802 | 95 | 1 | 0.002893 |
31+
| gpt-4-turbo | 7.88s | 1920 | 1802 | 118 | 1 | 0.02156 |
3032

3133
### Example 2: Wired
3234
**URL**: https://www.wired.com
3335
**Task**: List me all the articles with their description.
3436

3537
| Name | Execution time (seconds) | total_tokens | prompt_tokens | completion_tokens | successful_requests | total_cost_USD |
3638
| ------------------- | ------------------------ | ------------ | ------------- | ----------------- | ------------------- | -------------- |
37-
| gpt-3.5-turbo | | | | | | |
38-
| gpt-4-turbo-preview | | | | | | |
39+
| gpt-3.5-turbo | Error (text too long) | - | - | - | - | - |
40+
| gpt-4-turbo | Error (TPM limit reach)| - | - | - | - | - |
3941

examples/benchmarks/GenerateScraper/benchmark_openai_gpt35.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Define the configuration for the graph
2020
# ************************************************
2121

22-
openai_key = os.getenv("GPT35_KEY")
22+
openai_key = os.getenv("OPENAI_APIKEY")
2323

2424
graph_config = {
2525
"llm": {

examples/benchmarks/GenerateScraper/benchmark_openai_gpt4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
# Define the configuration for the graph
2020
# ************************************************
2121

22-
openai_key = os.getenv("GPT4_KEY")
22+
openai_key = os.getenv("OPENAI_APIKEY")
2323

2424
graph_config = {
2525
"llm": {
2626
"api_key": openai_key,
27-
"model": "gpt-4-turbo-preview",
27+
"model": "gpt-4-turbo-2024-04-09",
2828
},
2929
"library": "beautifoulsoup"
3030
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
OPENAI_APIKEY="your openai api key"
1+
OPENAI_APIKEY="your openai key here"

examples/benchmarks/SmartScraper/Readme.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ The two websites benchmark are:
55

66
Both are strored locally as txt file in .txt format because in this way we do not have to think about the internet connection
77

8+
In particular, is tested with SmartScraper
9+
810
| Hardware | Moodel | Example 1 | Example 2 |
911
| ------------------ | --------------------------------------- | --------- | --------- |
1012
| Macbook 14' m1 pro | Mistral on Ollama with nomic-embed-text | 11.60s | 26.61s |
1113
| Macbook m2 max | Mistral on Ollama with nomic-embed-text | 8.05s | 12.17s |
1214
| Macbook 14' m1 pro | Llama3 on Ollama with nomic-embed-text | 29.871 | 35.32 |
13-
| Macbook m2 max | Llama3 on Ollama with nomic-embed-text | | |
15+
| Macbook m2 max | Llama3 on Ollama with nomic-embed-text | 18.36s | 78.32s |
1416

1517

1618
**Note**: the examples on Docker are not runned on other devices than the Macbook because the performance are to slow (10 times slower than Ollama). Indeed the results are the following:
@@ -23,17 +25,17 @@ Both are strored locally as txt file in .txt format because in this way we do n
2325
**URL**: https://perinim.github.io/projects
2426
**Task**: List me all the projects with their description.
2527

26-
| Name | Execution time (seconds) | total_tokens | prompt_tokens | completion_tokens | successful_requests | total_cost_USD |
27-
| ------------------- | ------------------------ | ------------ | ------------- | ----------------- | ------------------- | -------------- |
28-
| gpt-3.5-turbo | 25.22 | 445 | 272 | 173 | 1 | 0.000754 |
29-
| gpt-4-turbo-preview | 9.53 | 449 | 272 | 177 | 1 | 0.00803 |
28+
| Name | Execution time | total_tokens | prompt_tokens | completion_tokens | successful_requests | total_cost_USD |
29+
| ------------------- | ---------------| ------------ | ------------- | ----------------- | ------------------- | -------------- |
30+
| gpt-3.5-turbo | 5.58s | 445 | 272 | 173 | 1 | 0.000754 |
31+
| gpt-4-turbo | 9.76s | 445 | 272 | 173 | 1 | 0.00791 |
3032

3133
### Example 2: Wired
3234
**URL**: https://www.wired.com
3335
**Task**: List me all the articles with their description.
3436

3537
| Name | Execution time (seconds) | total_tokens | prompt_tokens | completion_tokens | successful_requests | total_cost_USD |
3638
| ------------------- | ------------------------ | ------------ | ------------- | ----------------- | ------------------- | -------------- |
37-
| gpt-3.5-turbo | 25.89 | 445 | 272 | 173 | 1 | 0.000754 |
38-
| gpt-4-turbo-preview | 64.70 | 3573 | 2199 | 1374 | 1 | 0.06321 |
39+
| gpt-3.5-turbo | 6.50 | 2442 | 2199 | 243 | 1 | 0.003784 |
40+
| gpt-4-turbo | 76.07 | 3521 | 2199 | 1322 | 1 | 0.06165 |
3941

examples/benchmarks/SmartScraper/benchmark_openai_gpt35.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# Define the configuration for the graph
2020
# ************************************************
2121

22-
openai_key = os.getenv("GPT35_KEY")
22+
openai_key = os.getenv("OPENAI_APIKEY")
2323

2424
graph_config = {
2525
"llm": {

examples/benchmarks/SmartScraper/benchmark_openai_gpt4.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
# Define the configuration for the graph
2121
# ************************************************
2222

23-
openai_key = os.getenv("GPT4_KEY")
23+
openai_key = os.getenv("OPENAI_APIKEY")
2424

2525
graph_config = {
2626
"llm": {
2727
"api_key": openai_key,
28-
"model": "gpt-4-turbo-preview",
28+
"model": "gpt-4-turbo",
2929
},
3030
}
3131

scrapegraphai/helpers/models_tokens.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
"gpt-3.5-turbo-instruct": 4096,
1010
"gpt-4-0125-preview": 128000,
1111
"gpt-4-turbo-preview": 128000,
12+
"gpt-4-turbo": 128000,
13+
"gpt-4-turbo-2024-04-09": 128000,
1214
"gpt-4-1106-preview": 128000,
1315
"gpt-4-vision-preview": 128000,
1416
"gpt-4": 8192,

0 commit comments

Comments
 (0)