| |
| """ |
| Add output/input price multiple to the quadrants CSV. |
| This calculates how many times more expensive output tokens are compared to input tokens. |
| """ |
|
|
| import pandas as pd |
|
|
| |
| df = pd.read_csv('quadrants.csv') |
|
|
| |
| |
| df['output_input_multiple'] = df.apply( |
| lambda row: row['output_price_usd_per_m'] / row['input_price_usd_per_m'] |
| if row['input_price_usd_per_m'] > 0 else 0, |
| axis=1 |
| ) |
|
|
| |
| df.to_csv('quadrants.csv', index=False) |
|
|
| |
| median_multiple = df['output_input_multiple'].median() |
| mean_multiple = df['output_input_multiple'].mean() |
| min_multiple = df['output_input_multiple'].min() |
| max_multiple = df['output_input_multiple'].max() |
|
|
| print(f"Output/Input Price Multiple Statistics:") |
| print(f" Median: {median_multiple:.2f}x") |
| print(f" Mean: {mean_multiple:.2f}x") |
| print(f" Min: {min_multiple:.2f}x") |
| print(f" Max: {max_multiple:.2f}x") |
| print(f"\nTotal models: {len(df)}") |
| print(f"\nModels by output/input multiple:") |
| print(f" 1x (equal pricing): {len(df[df['output_input_multiple'] == 1])}") |
| print(f" <2x: {len(df[df['output_input_multiple'] < 2])}") |
| print(f" 2-5x: {len(df[(df['output_input_multiple'] >= 2) & (df['output_input_multiple'] < 5)])}") |
| print(f" 5-10x: {len(df[(df['output_input_multiple'] >= 5) & (df['output_input_multiple'] < 10)])}") |
| print(f" 10x+: {len(df[df['output_input_multiple'] >= 10])}") |
|
|