← Về thư mục
skills/using-model-endpoint/provider.py
- InferProvider · class · L20-L154 — class InferProvider: # The prologue strips any ambient INFER_/NVIDIA_ vars before auth: the # only way an API key may enter this process is the host's fd-3 auth # handshake.
- init · method · L28-L29 — def init(self, *, repl: bool = False)
- apply_auth · method · L89-L110 — def apply_auth(self, creds: dict[str, str]) -> None: # Hosted endpoints hand over {api_key} (resolved from the # registration's credential); local endpoints send nothing. Re-export # as INFER_API_KEY — the canonical, provider-agnostic name — so cells # can build their own Authorization header.
- import_and_patch · method · L112-L116 — def import_and_patch(self) -> None: # Nothing to import or patch — cells import httpx themselves and the # sandbox proxy env (HTTPS_PROXY/…) already routes them through the # endpoint-scoped filter.
- install_unauth_hook · method · L118-L120 — def install_unauth_hook(self, on_expired: Callable[[], NoReturn]) -> None: # No SDK to hook; a 401 from the endpoint surfaces in the cell output.
- _unsupported · method · L124-L129 — def _unsupported(self) -> NoReturn
- create_sandbox · method · L131-L134 — def create_sandbox( self, spec: dict[str, Any], install_id: str, tags: dict[str, str] | None = None ) -> str
- exec · method · L136-L145 — def exec( self, sandbox_id: str, argv: list[str], *, stdin: Iterable[bytes] | None = None, env: dict[str, str] | None = None, timeout: int | None = None, ) -> ExecResult
- list_owned · method · L147-L148 — def list_owned(self, install_id: str) -> list[dict[str, Any]]
- read_owner · method · L150-L151 — def read_owner(self, sandbox_id: str) -> str | None
- terminate · method · L153-L154 — def terminate(self, sandbox_id: str) -> None