Skip to content

sergejost/OpenAIModelBenchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📄 CV Skill Extractor & OpenAI Model Benchmark

Extracts professional skills from a CV (in PDF format) using various OpenAI models and benchmarks their speed, token usage and estimated cost.

This tool provides a simple GUI file picker, processes the CV, queries multiple models, and prints a comparison table.


✨ Features

  • 📂 Select CV as a PDF via file dialog (Tkinter)
  • 🧠 Extract skills using multiple OpenAI models
  • ⏱ Measure response time for each model
  • 🔢 Count input & output tokens
  • 💰 Estimate cost based on model pricing
  • 📊 Display benchmark results in a formatted table
  • 🧾 Clean bullet-point skill output

🧩 Included Models

  • gpt-5-mini
  • gpt-5-nano
  • gpt-4.1-mini
  • gpt-4.1-nano

You can modify the list in:

MODELS = [...]

💸 Pricing

Pricing is hardcoded (updated 16.02.2026) and used for cost estimation.

PRICING = {
    "model": {
        "input_per_1m": ...,
        "output_per_1m": ...
    }
}

To verify and/or update pricing visit https://developers.openai.com/api/docs/pricing


⚙️ Requirements

Install dependencies:

pip install openai pypdf tiktoken tabulate

or

conda install openai pypdf tiktoken tabulate

Tkinter is included with most Python installations.


🔑 Environment Setup

Set your OpenAI API key:

export OPENAI_API_KEY="your_api_key_here"

or

setx OPENAI_API_KEY "your_api_key_here"

▶️ Usage

Run the script:

python ./cv_parser_benchmark.py

Workflow

  1. File dialog opens
  2. Select a CV in PDF format
  3. Text is extracted
  4. Each model:
    • Extracts skills
    • Prints output (to compare with other models)
    • Measures response time
    • Counts tokens
    • Estimates cost
  5. Result performance table is displayed

📊 Example Output

=== Benchmarking gpt-5-mini ===
Extracted skills:
 • Python
 • SQL
 • Machine Learning
 ...

=== BENCHMARK RESULTS ===

+--------------+----------+--------------+---------------+-------------------+
| Model        | Time (s) | Input Tokens | Output Tokens | Estimated Cost ($)|
+--------------+----------+--------------+---------------+-------------------+
| gpt-5-mini   | 1.32     | 1450         | 120           | 0.00089           |
| gpt-5-nano   | 0.98     | 1450         | 118           | 0.00021           |
+--------------+----------+--------------+---------------+-------------------+

🔧 Customization

Change the prompt

Modify:

input = [...]

Benchmark only one model

MODELS = ["gpt-4.1-nano"]

Use your own pricing

Update the PRICING dictionary.

Benchmark more models

Update MODELS and PRICING sections


⚠️ Notes

  • Token counts are estimated locally (may slightly differ from API billing).
  • Very large CVs will increase cost and latency.
  • Works with text-based PDFs (not scanned images).
  • To work with scanned images it is recommended to execute text extraction on OpenAI side (will increase costs)

⭐ If you find this useful, give it a star!

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages