Skip to content

Latest commit

 

History

History
123 lines (111 loc) · 5.41 KB

README.md

File metadata and controls

123 lines (111 loc) · 5.41 KB

OSINTbench is a benchmark for evaluating how well large language models can perform open-source intelligence (OSINT) tasks. Categories include:

  • Geolocation: Spatial reasoning
  • Identification: Information synthesis, breadth of knowledge
  • Temporal: Temporal reasoning
  • Analysis: General reasoning

Installation

Needs uv.

git clone https://github.com/ccmdi/osintbench.git
cd osintbench
uv sync
cp .env.example .env

Fill in the key for each provider you want to test in .env. Reverse image search runs Google Lens through Chrome, so install Chrome if you want that tool live.

Dataset

You will need to manually create a dataset for this to work. A split lives in dataset/<split>/ (basic or advanced):

dataset/
├─ basic/
│  ├─ metadata.json
│  ├─ images/
│  │  ├─ 1.png
│  │  ├─ 2.jpg
├─ advanced/
│  ├─ metadata.json
│  ├─ images/

metadata.json follows this schema:

{
  "cases": [
    {
      "id": 1,
      "images": ["images/1.png"],
      "info": "<context given to the model about the case>",
      "tasks": [
        {
          "id": 1,
          "type": "location",
          "prompt": "Find the exact location of the photo.",
          "answer": {"lat": <true_lat>, "lng": <true_lng>}
        },
        {
          "id": 2,
          "type": "identification",
          "prompt": "Who is this?",
          "answer": {"name": "<person_name>"}
        },
        {
          "id": 3,
          "type": "temporal",
          "prompt": "What date was this photo taken?",
          "answer": {"date": "YYYY-MM-DD"}
        },
        {
          "id": 4,
          "type": "analysis",
          "prompt": "What road was this photo taken on?",
          "answer": {"road": "<road_name>"}
        }
      ]
    }
  ]
}
  • images is optional. Image file names are matched case-insensitively.
  • location answers are {"lat", "lng"} in decimal degrees.
  • temporal answers are an ISO date (YYYY, YYYY-MM or YYYY-MM-DD; several accepted dates are joined with " or "), or free text when the task isn't asking for a date.
  • identification and analysis answers are a string, or an object of labelled parts.

Test a model

Pick a provider profile from configs/ and pass the model id with -m:

uv run --env-file .env vf-run @ configs/base.toml @ configs/openai.toml -m <model>

Profiles: openai, anthropic, gemini, xai, openrouter. Add --env.taskset.split advanced for the advanced split, and -n <cases> to run only the first few cases. Traces land in outputs/<run>/traces.jsonl.

To run only some task types, add one more @ file containing:

[env.taskset]
kinds = ["location", "temporal", "analysis"]

Trials and results

Run every case K times with -r K. Each trial is its own fresh episode:

uv run --env-file .env vf-run @ configs/base.toml @ configs/openai.toml -m <model> -r 3

Then build the report from one or more run folders. It only reads the saved traces, so no model gets called:

uv run python -m shungite.report outputs/<run> [outputs/<run> ...]

You get Markdown tables: per model, the pass rate, pass^k, pass@k, mean score with its spread across trials, tokens and wall time, then every task's score in each trial. --price-in / --price-out (USD per 1M tokens) turn the model's tokens into a cost, --judge-price-in / --judge-price-out do the same for the judge, and --json prints the numbers as JSON.

To browse the runs (scores per model and task, each case's answers and verdicts, the full transcript with tool calls), open the viewer on outputs/ or any run folders:

uv run --extra viz streamlit run visualizations/streamlit/app.py -- outputs

A task passes when it scores 1, except location, which passes within 500 m (a score of 0.8 or more). A judge UNKNOWN counts as neither a pass nor a fail and shows as ?. Tool results come from the tool cache (dataset/<split>/tool-cache/), so the same tool call gets the same result in every trial. Add --env.taskset.cache replay to use only recorded results, with no live searches; a call that was never recorded fails instead of going online.

Grading

Each case scores the mean of its tasks:

  • location: by distance, within 100 m / 500 m / 1 km / 10 km scores 1 / 0.8 / 0.5 / 0.2.
  • temporal dates: 1 when the date is at least as precise as the reference and matches it, else 0.
  • identification, analysis and text temporal answers: an LLM judge compares the answer with the reference and says CORRECT (1), INCORRECT (0) or UNKNOWN. A trace with an UNKNOWN verdict is dropped from the averages rather than scored 0.

The judge is set in configs/base.toml under [env.taskset.task.judge] (model, endpoint, key variable, temperature 0). Use a judge from a different model family than the model you're testing, or override it on the command line:

--env.taskset.task.judge.model <model> --env.taskset.task.judge.base-url <url> --env.taskset.task.judge.api-key-var <VAR>

To check the judge against hand-graded answers, write a JSONL file of {"case": "basic/27", "task": "1", "answer": "...", "human_label": "correct"} rows and run:

uv run --env-file .env python -m osintbench.calibrate <file.jsonl> -k 2

It prints agreement with the human labels, how often the verdict flips between runs, and the UNKNOWN rate.