fix(model): wire openai_compatible configuration across trainer, eval, and config pipeline - #262
Conversation
…, and config pipeline
|
Thanks Yifan Yang (@Yif-Yang) for the detailed review! I have addressed all 4 points in commit
|
… fresh-import regression
|
Thanks for wiring the previously missing entry points. Re-reviewing Offline reproduction, stopping the trainer immediately after model configuration (no provider request):
Please establish precedence once and preserve the resolved explicit per-role model through runtime setup; add trainer and eval regressions that inspect the real compatible configs or a fake client's request payload after all configuration calls. There is also the same new order-dependent MiniMax default assertion as in #255: running |
d3c3b81 to
0e88e38
Compare

Description
This PR connects the generic
openai_compatiblebackend across the configuration, trainer, and evaluation pipelines so that models served via OpenAI-compatible endpoints (such as DeepSeek, Groq, Together AI, vLLM, Ollama, LiteLLM, or local servers) can be fully configured via YAML configs,--cfg-options, or CLI flags and properly initialized during training and evaluation runs.Key Changes
skillopt/config.py): Added all 18model.openai_compatible_*mappings to_FLATTEN_MAPso YAML configs retain general and per-role (optimizer_/target_) settings during flattening.skillopt/model/openai_compatible_backend.py&skillopt/model/__init__.py): Extendedconfigure_openai_compatibleto support per-role overrides fortemperature,timeout_seconds, andmax_tokensacrossOPTIMIZER_CONFIGandTARGET_CONFIG.skillopt/engine/trainer.py): Addedconfigure_openai_compatible(...)call duringReflACTTrainer.train()initialization so parameters configured via YAML or CLI take effect during training and episode rollouts.scripts/eval_only.py): Added"openai_compatible","qwen", and"qwen_chat"to--backendchoices, added CLI flags, mapped them to structured keys inload_config, and invokedconfigure_openai_compatibleinmain().scripts/train.py): Added CLI arguments foropenai_compatible_*, mapped them in_LEGACY_TO_STRUCTURED, and added environment variable guidance (OPENAI_COMPATIBLE_API_KEY) for secure credential passing.tests/test_openai_compatible_config.py&tests/test_openai_compatible_backend.py): Added comprehensive test coverage for YAML config flattening, CLI overrides, role separation, trainer initialization, credential warnings, and eval_only script parsing.Verification
pytest tests/test_openai_compatible_config.py tests/test_openai_compatible_backend.py tests/test_azure_openai_compat.py tests/test_minimax_backend.py tests/test_minimax_region.py tests/test_qwen_backend.py tests/test_role_backend_resolution.py tests/test_codex_config_aliases.py tests/test_retired_cli_options.py tests/test_env_section_survives_dedup.py). All 175 tests passed.