Skip to content

Defer OpenAI/Anthropic SDK imports in model factory#348

Merged
korivi-CraftOS merged 1 commit into
mainfrom
factory-lazy-sdk-imports
Jun 29, 2026
Merged

Defer OpenAI/Anthropic SDK imports in model factory#348
korivi-CraftOS merged 1 commit into
mainfrom
factory-lazy-sdk-imports

Conversation

@korivi-CraftOS

Copy link
Copy Markdown
Collaborator

Lazy-loads the OpenAI and Anthropic SDKs in the model factory so a missing SDK for an unused provider can no longer break startup. When the needed SDK is genuinely absent, the factory raises a clear install hint.

This is the clean, self-contained portion of #347, taken at its final reviewed state (the abandoned HTTP-fallback client from the first commit is not included). The runtime-preflight and launcher-hardening parts of #347 are intentionally left out pending revisions discussed on that PR.

Credit to @namabeeru (co-authored).

Lazy-load provider SDKs so a missing SDK for an unused provider can't
break startup; raise a friendly install hint when the needed SDK is absent.

Cherry-picked from PR #347 (final factory.py state only; runtime-preflight
and launcher changes from that PR are left for revision).

Co-authored-by: namabeeru <github.body594@passmail.com>
@korivi-CraftOS korivi-CraftOS merged commit d37439f into main Jun 29, 2026
@korivi-CraftOS korivi-CraftOS deleted the factory-lazy-sdk-imports branch June 29, 2026 15:32
korivi-CraftOS added a commit that referenced this pull request Jun 29, 2026
This reverts commit a86a437.

Holding #347 pending revisions discussed on the PR: the runtime_preflight
probe should warn-and-continue (not sys.exit) on an inconclusive result,
and craftbot.py BACKEND_URL must derive from --backend-port instead of a
hardcoded 7926. The clean model-factory change was taken separately in #348.
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