Skip to content

Python samples still target foundry-local-sdk 0.x - plan to migrate to 1.x? #7

Description

@henesduran

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:

  1. 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?
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions