Download scripts/run_kaiju_router.py from RMDWLLC/kaiju-coder-7-opencode: direct link, hf CLI and curl.
- Browser
- Download file 2.44 kB
-
https://huggingface.co/RMDWLLC/kaiju-coder-7-opencode/resolve/main/scripts/run_kaiju_router.py
- Command line
-
hf download hf://RMDWLLC/kaiju-coder-7-opencode/scripts/run_kaiju_router.py
-
curl -L -o run_kaiju_router.py https://huggingface.co/RMDWLLC/kaiju-coder-7-opencode/resolve/main/scripts/run_kaiju_router.py
2.44 kB
| #!/usr/bin/env python3 | |
| """Run a customer prompt through the unified Kaiju harness router.""" | |
| from __future__ import annotations | |
| import argparse | |
| import os | |
| import sys | |
| from pathlib import Path | |
| ROOT = Path(__file__).resolve().parents[1] | |
| sys.path.insert(0, str(ROOT)) | |
| from kaiju_harness.router import result_to_json, run_task | |
| def main() -> int: | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("--prompt", required=True) | |
| parser.add_argument("--out-dir", type=Path, default=Path.cwd() / "kaiju-runs") | |
| parser.add_argument("--repo", type=Path, default=None) | |
| parser.add_argument( | |
| "--kind", | |
| default="auto", | |
| choices=["auto", "website", "business_document", "business_suite", "app", "code_project", "repo_patch", "coding"], | |
| ) | |
| parser.add_argument( | |
| "--openai-base-url", | |
| default=os.environ.get("KAIJU_OPENAI_BASE_URL"), | |
| help="Optional OpenAI-compatible endpoint for compact spec planning.", | |
| ) | |
| parser.add_argument("--model", default=os.environ.get("KAIJU_MODEL"), help="Model name for OpenAI-compatible spec planning.") | |
| parser.add_argument("--api-key-env", default="KAIJU_EVAL_API_KEY") | |
| parser.add_argument("--planner-timeout", type=int, default=90) | |
| parser.add_argument("--no-planner", action="store_true", help="Skip model spec planning and use deterministic rendering.") | |
| parser.add_argument("--print-manifest", action="store_true") | |
| args = parser.parse_args() | |
| openai_base_url = None if args.no_planner else args.openai_base_url | |
| model = None if args.no_planner else args.model | |
| result = run_task( | |
| args.prompt, | |
| args.out_dir, | |
| repo=args.repo, | |
| kind=args.kind, | |
| openai_base_url=openai_base_url, | |
| model=model, | |
| api_key_env=args.api_key_env, | |
| planner_timeout=args.planner_timeout, | |
| ) | |
| if args.print_manifest: | |
| print(result_to_json(result)) | |
| if result.errors: | |
| raise SystemExit("; ".join(result.errors)) | |
| print(f"Task type: {result.task_type}") | |
| print(f"Artifact type: {result.artifact_type}") | |
| print(f"Manifest: {result.manifest_path}") | |
| if result.artifact_path: | |
| print(f"Artifact: {result.artifact_path}") | |
| if result.project_dir: | |
| print(f"Project/repo: {result.project_dir}") | |
| print(f"Changed files: {len(result.changed_files)}") | |
| return 0 | |
| if __name__ == "__main__": | |
| raise SystemExit(main()) | |