GPT-OSS Tool-Call Harness (HF Inference)
This repo runs prompts against openai/gpt-oss-20b:groq (or any OpenAI-compatible HF model), supplies a set of fake tools, captures when the model attempts tool-calls, then simulates tool failures and logs the follow-up response.
Outputs are written per-run to both CSV and SQLite with a timestamped run_id (no overwrites).
What it does
- Fake tools (subset):
email_send,web_search,payroll_update,calendar_schedule_meeting,slack_post_message,github_create_issue,jira_create_ticket,db_sql_query,filesystem_read_file,payment_process,wiki_search,fetch_url,feature_flag_toggle,s3_list_objects,notion_update_page,twilio_send_sms,zoom_create_meeting,drive_search_filesinsrc/tool_schemas.py. - Initial turn: Sends your prompt with
tools=...and records any tool calls. - Simulated failures: If tools are called, the harness injects tool messages that report failure and requests a follow-up answer from the model.
- Logging:
- CSV files:
data/logs/run_<run_id>_interactions.csv,data/logs/run_<run_id>_tool_calls.csv - SQLite DB:
data/logs/run_<run_id>.db(tables:runs,interactions,tool_calls)
- CSV files:
Setup
- Python 3.10+
- Install deps
python -m venv .venv # Windows PowerShell activation: .venv\\Scripts\\Activate.ps1 pip install -r requirements.txt
- Add your HF Inference token
- Copy
.env.exampleto.env - Set
HF_TOKEN=...
- Copy
Run
-
Using sample prompts (console script):
ossrt-harness --prompts-file prompts/examples.jsonl \ --model openai/gpt-oss-20b:groq \ --base-url https://router.huggingface.co/v1 \ --temperature 0.2 --top-p 1.0 \ --notes "smoke"
-
Override system prompt with a local file:
ossrt-harness --system-prompt-file prompts/system.txt
-
Note:
--cotis deprecated (no-op). GPT-OSS emits reasoning via Harmony channels automatically.
Inspect outputs
- CSVs in
data/logs/ - SQLite database
data/logs/run_<run_id>.dbwith tables:runs(run_id, created_at, model, base_url, tools_json, prompts_file, notes, temperature, top_p)interactions(run_id, prompt_idx, phase, role, content, tool_calls_json, raw_json, finish_reason, prompt_tokens, completion_tokens)tool_calls(run_id, prompt_idx, call_idx, tool_call_id, name, arguments_json)
Notes
- This harness does not execute tools. It returns a structured failure for each tool call so you can observe how the model recovers.
- Some providers return old-style
function_callinstead oftool_calls. The harness supports both. - Chain-of-thought flags (
--cot) are deprecated and have no effect. GPT-OSS emits reasoning via Harmony channels (analysis/final).
Customization
- Add/edit tools in
src/tool_schemas.py. - Provide your own prompts via
.jsonl,.json, or.txt. - Extend logging or add new export formats as needed.
Metadata
Release files for oss-redteam 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oss_redteam-0.1.1.tar.gz | 18.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| oss_redteam-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.4 kB
Release files / oss_redteam-0.1.1.tar.gz
| Download URL | oss_redteam-0.1.1.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30a3b4c8e2c02216a8dbe340c5b6ed66565828155f1e1482803d928a8cbdc63d
|
|
BLAKE2b-256 checksum How to use checksums |
7d6de6ae4ae47fa795cd6e3d05b2006dc9e8b31d207e544699666a0fb3d2fed1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|
Release files / oss_redteam-0.1.1-py3-none-any.whl
| Download URL | oss_redteam-0.1.1-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a92755c916cf672e6bd037e478b202921537a72715b030145523be6552162d37
|
|
BLAKE2b-256 checksum How to use checksums |
e161fc4316820403db0ee6524c676f885f759bc17ce123e95e96405b8d24b558
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.4
|