The Python samples under python/ are written against the 0.x line of foundry-local-sdk:
requirements.txt pins foundry-local-sdk>=0.5.0,<1.0.0
- the examples use the 0.x import and API, e.g.
from foundry_local import FoundryLocalManager, manager.start_service(), manager.get_model_info(), manager.download_model(), manager.load_model(), and the OpenAI client via manager.endpoint / manager.api_key.
Meanwhile foundry-local-sdk is now at 1.2.3 on PyPI, and 1.0 was a breaking change. The 1.x API is quite different:
from foundry_local_sdk import Configuration, FoundryLocalManager
FoundryLocalManager.initialize(Configuration(app_name=...)) → FoundryLocalManager.instance
- model access moves under
manager.catalog (catalog.get_model(alias) → model.is_cached / model.download() / model.load() / model.unload())
- inference via
model.get_chat_client().complete_streaming_chat(messages=...) instead of the OpenAI client (manager.endpoint / api_key no longer exist)
So installing foundry-local-sdk today (which resolves to 1.x if the pin is relaxed) breaks the samples.
A couple of questions before anyone puts up a PR:
- Is the
<1.0.0 pin deliberate (e.g. 1.x isn't GA on all target platforms yet, or the lab guides intentionally track 0.x), or is it just that the samples predate 1.x?
- If you'd welcome it, I'm happy to migrate the Python samples to 1.x. It'd need to be done consistently across
python/ plus the labs/*.md guides that reference the same API, so I wanted to check direction before doing the work rather than dropping a large unsolicited PR.
Happy to scope it to just the Python side first if that's easier to review.
The Python samples under
python/are written against the 0.x line offoundry-local-sdk:requirements.txtpinsfoundry-local-sdk>=0.5.0,<1.0.0from foundry_local import FoundryLocalManager,manager.start_service(),manager.get_model_info(),manager.download_model(),manager.load_model(), and the OpenAI client viamanager.endpoint/manager.api_key.Meanwhile
foundry-local-sdkis now at 1.2.3 on PyPI, and 1.0 was a breaking change. The 1.x API is quite different:from foundry_local_sdk import Configuration, FoundryLocalManagerFoundryLocalManager.initialize(Configuration(app_name=...))→FoundryLocalManager.instancemanager.catalog(catalog.get_model(alias)→model.is_cached/model.download()/model.load()/model.unload())model.get_chat_client().complete_streaming_chat(messages=...)instead of the OpenAI client (manager.endpoint/api_keyno longer exist)So installing
foundry-local-sdktoday (which resolves to 1.x if the pin is relaxed) breaks the samples.A couple of questions before anyone puts up a PR:
<1.0.0pin deliberate (e.g. 1.x isn't GA on all target platforms yet, or the lab guides intentionally track 0.x), or is it just that the samples predate 1.x?python/plus thelabs/*.mdguides that reference the same API, so I wanted to check direction before doing the work rather than dropping a large unsolicited PR.Happy to scope it to just the Python side first if that's easier to review.