Skip to content

Modernize packaging and add unified inference module#39

Merged
Oaklight merged 2 commits intomainfrom
feature/modernize
Apr 10, 2026
Merged

Modernize packaging and add unified inference module#39
Oaklight merged 2 commits intomainfrom
feature/modernize

Conversation

@Oaklight
Copy link
Copy Markdown
Owner

Summary

  • Replace setup.py + eval_requirements.txt / infer_requirements.txt with a modern pyproject.toml (PEP 517/518, setuptools backend)
  • Fix security issue: replace eval() with ast.literal_eval() in parse_raw_output()
  • Fix bare retry() decorator calls in gpt.py and claude.py (were no-ops, now properly applied)
  • Fix broken relative imports in inference/main.py
  • Remove fire dependency from evaluate.py, replace with argparse
  • Remove unused imports (sys, Union)
  • Add deprecation warnings to legacy model modules (claude.py, gpt.py, llama.py, rwkv.py)
  • Add new BaseModel ABC and OpenAIModel for unified inference via any OpenAI-compatible endpoint
  • Add openai-compatible model option with --base-url, --api-mode, and --model-id CLI arguments
  • Add initial test suite (tests/test_evaluation.py) covering edit_distance and parse_raw_output
  • Run ruff check --fix, ruff format, and ty check across the codebase

Test plan

  • All 6 tests pass (pytest tests/ -v)
  • ruff check passes with zero errors
  • ruff format produces no changes
  • ty check passes with zero errors
  • Verify mango-eval CLI still works with existing inference results
  • Verify openai-compatible model option works end-to-end against an OpenAI-compatible endpoint

- Replace setup.py + requirements files with pyproject.toml (PEP 517/518)
- Fix eval() usage with ast.literal_eval() for security
- Fix bare retry() decorator calls in gpt.py and claude.py
- Fix relative imports in inference/main.py
- Remove fire dependency from evaluate.py, replace with argparse
- Remove unused imports (sys, Union)
- Add deprecation warnings to legacy model modules
- Add new BaseModel ABC and OpenAIModel for unified inference
- Add openai-compatible model option to inference CLI
- Add initial test suite for evaluation utilities
- Run ruff check/format and ty check across codebase
The newer OpenAI API requires max_completion_tokens for chat
completions. The old max_tokens parameter is rejected by recent
models.
@Oaklight Oaklight merged commit 68d979b into main Apr 10, 2026
7 checks passed
@Oaklight Oaklight deleted the feature/modernize branch April 10, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant