Replace InspectAI with OpenAI proxy and use vector's proxy - #159
Conversation
Route LLM calls through the official OpenAI client to https://proxy.vectorinstitute.ai/v1 with per-call clients and keys, drop inspect-ai, and update tests/docs accordingly. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the Sample dataclass and pass prompt strings directly into execute_samples_against_model. Co-authored-by: Cursor <cursoragent@cursor.com>
Use bare proxy model names, remove unused key-name metadata, and sync tests and docs. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@coderabbitai full review |
Take main's lockfile as the base, then regenerate with uv for the OpenAI proxy dependency set. Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughThe evaluation implementation now uses the OpenAI SDK through the Vector proxy. Model metadata uses unprefixed proxy model IDs, and API keys pass to per-request clients. InspectAI execution and related dependencies were removed. Systematization and UI call sites now send prompt strings directly. Tests mock OpenAI clients and cover request handling, output parsing, and errors. Documentation and repository checks were updated. Estimated code review effort: 4 (Complex) | ~45 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plans/2026-08-10-replace-inspectai-with-openai-proxy.md`:
- Around line 30-32: Update the plan step describing InspectAI Sample
replacement to state that Sample is removed and prompt strings are passed
directly to execute_samples_against_model; remove the inaccurate reference to
introducing a local type.
In `@src/aspis/inferencer.py`:
- Around line 97-103: Update evaluate_text and its evaluate endpoint boundary so
the synchronous OpenAI chat.completions.create call does not block the FastAPI
event loop: either use AsyncOpenAI or offload the call to a threadpool, and
configure an explicit request timeout for the model request.
In `@tests/aspis/ui/test_main.py`:
- Line 304: Update the test setup around make_openai_side_effect in test_main.py
so the answer-submission mock returns valid SystematizedConcept payloads, with
each concept dictionary containing title, body, and prompt_template. Keep the
test focused on verifying saved answers while preventing concept generation from
taking the error path.
- Line 175: Update the assertion in the test around the invalid and valid
submissions to verify the OpenAI client mock is called exactly once, replacing
the looser mock_openai.assert_called() check while preserving the existing
input-validation flow.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: b9006b27-4570-44e0-a291-4c8a3e11faea
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (14)
.github/workflows/code_checks.yml.gitignoreCONTRIBUTING.mdREADME.mdplans/2026-08-10-replace-inspectai-with-openai-proxy.mdpyproject.tomlsrc/aspis/api/main.pysrc/aspis/inferencer.pysrc/aspis/systematization.pytests/aspis/api/test_main.pytests/aspis/manual_test_inferencer.pytests/aspis/test_inferencer.pytests/aspis/test_systematization.pytests/aspis/ui/test_main.py
💤 Files with no reviewable changes (1)
- .github/workflows/code_checks.yml
|
Note Docstrings generation - SUCCESS |
Docstrings generation was requested by @lotif. The following files were modified: * `src/aspis/api/main.py` * `src/aspis/inferencer.py` * `src/aspis/systematization.py` * `tests/aspis/api/test_main.py` * `tests/aspis/ui/test_main.py` These files were kept as they were: * `tests/aspis/manual_test_inferencer.py` * `tests/aspis/test_inferencer.py` * `tests/aspis/test_systematization.py` These file types are not supported: * `.github/workflows/code_checks.yml` * `.gitignore` * `CONTRIBUTING.md` * `README.md` * `plans/2026-08-10-replace-inspectai-with-openai-proxy.md` * `pyproject.toml`
This reverts commit 40625e3.
Keep the FastAPI event loop responsive by offloading the blocking model call to a thread, bound proxy requests with an explicit client timeout, and tighten the UI tests so they assert the real client contract. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Type
Feature
Short Description
Note: first time using agents to make the code for me using the Vibe Crafting skill.
Using OpenAI API instead of InspectAI to make LLM calls so we can use the Vector proxy (or any other proxy).
Additionally: Updated click v8.2.1 -> v8.4.2
Tests Added
Only updating existing tests
Summary by CodeRabbit
New Features
Documentation
Maintenance