model.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. """``hermes model`` subcommand parser."""
  2. from __future__ import annotations
  3. from typing import Callable
  4. def build_model_parser(subparsers, *, cmd_model: Callable) -> None:
  5. """Attach the ``model`` subcommand to ``subparsers``."""
  6. model_parser = subparsers.add_parser(
  7. "model", help="Select default model and provider",
  8. description="Interactively select your inference provider and default model")
  9. model_parser.add_argument(
  10. "--refresh", action="store_true",
  11. help="Wipe the model picker disk cache and re-fetch every provider's live /v1/models list.")
  12. model_parser.add_argument(
  13. "--portal-url", help="Portal base URL for Nous login (default: production portal)")
  14. model_parser.add_argument(
  15. "--inference-url",
  16. help="Inference API base URL for Nous login (default: production inference API)")
  17. model_parser.add_argument(
  18. "--client-id", default=None,
  19. help="OAuth client id to use for Nous login (default: hermes-cli)")
  20. model_parser.add_argument("--scope", default=None, help="OAuth scope to request for Nous login")
  21. model_parser.add_argument(
  22. "--no-browser", action="store_true",
  23. help="Do not attempt to open the browser automatically during Nous login")
  24. model_parser.add_argument(
  25. "--timeout", type=float, default=15.0,
  26. help="HTTP request timeout in seconds for Nous login (default: 15)")
  27. model_parser.add_argument(
  28. "--ca-bundle", help="Path to CA bundle PEM file for Nous TLS verification")
  29. model_parser.add_argument(
  30. "--insecure", action="store_true",
  31. help="Disable TLS verification for Nous login (testing only)")
  32. model_parser.set_defaults(func=cmd_model)