Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Adds an MVP Python SDK under sdk/python that wraps Foundry Local Core via ctypes, provides model discovery/load operations plus OpenAI-compatible chat/audio clients, and introduces pytest-based integration tests and CI build steps.
Changes:
- Introduce Python SDK runtime: configuration, core interop layer, catalog/model abstractions, and OpenAI-style chat/audio clients.
- Add pytest integration tests + shared fixtures mirroring the JS/C# SDK test suites.
- Add GitHub Actions workflow steps to build Python wheels (standard + WinML) and run tests.
Reviewed changes
Copilot reviewed 37 out of 40 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/test/test_model.py | Model caching + load/unload lifecycle tests |
| sdk/python/test/test_foundry_local_manager.py | Manager initialization + catalog exposure tests |
| sdk/python/test/test_catalog.py | Catalog listing/lookup/cached/variant tests |
| sdk/python/test/openai/test_chat_client.py | Chat completion + streaming + validation tests |
| sdk/python/test/openai/test_audio_client.py | Audio transcription + streaming + validation tests |
| sdk/python/test/openai/init.py | Test package marker for openai tests |
| sdk/python/test/detail/test_model_load_manager.py | ModelLoadManager tests for core + external service modes |
| sdk/python/test/detail/init.py | Test package marker for detail tests |
| sdk/python/test/conftest.py | Session fixtures and shared test configuration/constants |
| sdk/python/test/init.py | Test package marker |
| sdk/python/test/README.md | Test suite setup and execution instructions |
| sdk/python/src/version.py | SDK version definition |
| sdk/python/src/openai/chat_client.py | OpenAI-compatible chat client implementation |
| sdk/python/src/openai/audio_client.py | OpenAI-compatible audio transcription client implementation |
| sdk/python/src/openai/init.py | Public exports for openai-compatible clients |
| sdk/python/src/model_variant.py | Variant-level model operations + client creation |
| sdk/python/src/model.py | Alias-level model wrapper + variant selection |
| sdk/python/src/logging_helper.py | Log level mapping + default logger severity helper |
| sdk/python/src/imodel.py | Abstract model interface |
| sdk/python/src/foundry_local_manager.py | Singleton manager: init, catalog creation, web service control |
| sdk/python/src/exception.py | SDK base exception type |
| sdk/python/src/detail/utils.py | Native binary discovery + install/verify CLI utility |
| sdk/python/src/detail/model_load_manager.py | Load/unload/list-loaded via core interop or external web service |
| sdk/python/src/detail/model_data_types.py | Pydantic types for catalog/model metadata |
| sdk/python/src/detail/core_interop.py | ctypes FFI bridge to native Core library |
| sdk/python/src/detail/init.py | Re-exports for detail layer |
| sdk/python/src/configuration.py | Configuration object + validation + serialization |
| sdk/python/src/catalog.py | Catalog caching/refresh + lookup + cached/loaded queries |
| sdk/python/src/init.py | Top-level package exports + basic logger setup |
| sdk/python/requirements.txt | Runtime dependencies for standard variant |
| sdk/python/requirements-winml.txt | Runtime dependencies for WinML variant |
| sdk/python/requirements-dev.txt | Dev/test dependencies aggregation |
| sdk/python/pyproject.toml | Packaging metadata, scripts, pytest config |
| sdk/python/examples/chat_completion.py | Example usage: discover, load, chat (streaming + non-streaming) |
| sdk/python/build_backend.py | PEP517 build backend shim for WinML variant builds |
| sdk/python/README.md | SDK installation + usage documentation |
| sdk/python/LICENSE.txt | MIT license for the Python package |
| sdk/python/.gitignore | Ignore build artifacts/logs/venv caches for Python SDK |
| .github/workflows/foundry-local-sdk-build.yml | Add Python build jobs to the SDK build workflow |
| .github/workflows/build-python-steps.yml | New reusable workflow to build/install/test Python wheels |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…microsoft/Foundry-Local into prathikrao/implement-python-sdk
There was a problem hiding this comment.
Pull request overview
Introduces an MVP Foundry Local Python SDK with OpenAI-compatible chat/audio clients, plus packaging, examples, and CI/test coverage to validate end-to-end model discovery/load/inference.
Changes:
- Adds core SDK primitives (Configuration, FoundryLocalManager, Catalog/Model/Variant) and ctypes Core interop.
- Implements OpenAI-compatible ChatClient (including streaming + tool calling) and AudioClient (streaming + non-streaming transcription).
- Adds pytest integration tests and GitHub Actions workflow steps to build wheels and run the Python test suite.
Reviewed changes
Copilot reviewed 38 out of 41 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/python/test/test_model.py | Adds model cache + load/unload lifecycle tests |
| sdk/python/test/test_foundry_local_manager.py | Adds manager initialization/catalog smoke tests |
| sdk/python/test/test_catalog.py | Adds catalog listing and lookup tests |
| sdk/python/test/openai/test_chat_client.py | Adds chat completion + streaming + tool-calling tests |
| sdk/python/test/openai/test_audio_client.py | Adds audio transcription tests (streaming + non-streaming) |
| sdk/python/test/detail/test_model_load_manager.py | Adds model load manager tests (core interop + external service) |
| sdk/python/test/conftest.py | Adds shared pytest fixtures and test configuration helpers |
| sdk/python/test/README.md | Documents Python test suite setup and structure |
| sdk/python/src/version.py | Introduces SDK version module for packaging/user-agent |
| sdk/python/src/openai/chat_client.py | Implements OpenAI-compatible chat client + settings/validation |
| sdk/python/src/openai/audio_client.py | Implements OpenAI-compatible audio transcription client |
| sdk/python/src/openai/init.py | Exports OpenAI-compatible client APIs |
| sdk/python/src/model_variant.py | Adds ModelVariant operations (download/cache/load + client factories) |
| sdk/python/src/model.py | Adds Model wrapper for variants and selection |
| sdk/python/src/logging_helper.py | Adds log-level mapping + default logger configuration |
| sdk/python/src/imodel.py | Defines the model interface used by Model/ModelVariant |
| sdk/python/src/foundry_local_manager.py | Adds singleton manager initialization + optional web service controls |
| sdk/python/src/exception.py | Adds SDK base exception type |
| sdk/python/src/detail/utils.py | Adds native binary discovery + CLI installer/validator |
| sdk/python/src/detail/model_load_manager.py | Adds model load/unload/list via core interop or web service |
| sdk/python/src/detail/model_data_types.py | Adds Pydantic models for catalog/model metadata |
| sdk/python/src/detail/core_interop.py | Adds ctypes FFI layer for Foundry Local Core + callbacks |
| sdk/python/src/detail/init.py | Adds detail package exports for convenience imports |
| sdk/python/src/configuration.py | Adds configuration model + validation + serialization |
| sdk/python/src/catalog.py | Implements catalog refresh, listing, cached/loaded queries |
| sdk/python/src/_str_enum.py | Adds StrEnum compatibility shim for Python 3.10 |
| sdk/python/src/init.py | Sets up package exports + default logging handler |
| sdk/python/requirements.txt | Defines runtime dependencies for standard variant |
| sdk/python/requirements-winml.txt | Defines runtime dependencies for WinML variant |
| sdk/python/requirements-dev.txt | Defines dev/test dependencies |
| sdk/python/pyproject.toml | Adds packaging metadata + build backend wiring + pytest config |
| sdk/python/examples/chat_completion.py | Adds example demonstrating basic chat + streaming usage |
| sdk/python/build_backend.py | Adds PEP 517 backend shim to build WinML vs standard wheels |
| sdk/python/README.md | Adds SDK documentation (install, usage, API overview) |
| sdk/python/LICENSE.txt | Adds MIT license file for Python package |
| sdk/python/.gitignore | Adds Python SDK-specific ignores |
| .github/workflows/foundry-local-sdk-build.yml | Wires Python SDK build jobs into main build workflow |
| .github/workflows/build-python-steps.yml | Adds reusable workflow to build/install wheel and run pytest |
Comments suppressed due to low confidence (1)
sdk/python/src/openai/chat_client.py:1
- New validation behavior for
response_formatandtool_choiceis introduced here, but the added tests only appear to cover valid configurations. Add pytest cases that assert invalid shapes/types raise the expected exceptions (e.g., unknowntype, missing/extra fields, and function tool_choice missingname) to prevent silently regressing these guards.
# -------------------------------------------------------------------------
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mvp