Registry / ai-ml / foundry-local-sdk

foundry-local-sdk

JSON →
library1.2.3pypypi✓ verified 84d ago

Foundry Local SDK for Python provides a control-plane interface to Foundry Local, a unified on-device AI runtime that enables local generative AI inference. It allows developers to interact with locally run models, perform chat completions, and manage local AI resources without network latency or per-token costs. The current version is 1.0.0, and it has moved to General Availability, suggesting a stable, but potentially evolving, release cadence.

pip install foundry-local-sdk
INSTALL
IMPORT
SIG · FOUNDRY-LOCAL-SDK
F
foundry-local-sdk
ai-mlpythonv1.2.3
Install
12.1s avg
Import
Disk
299MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 32.4MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 12.1s · import 0.000s · 32MB
299MB installed
● package 299MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FoundryLocalManager
from foundry_local_sdk import FoundryLocalManager
from foundry import FoundryLocal
Configuration
from foundry_local_sdk import Configuration
catalog
from foundry_local_sdk import catalog

Initializes the Foundry Local client and performs a simple chat completion using a locally available model. Before running, ensure the Foundry Local runtime is installed and running, and a model (e.g., `phi3-mini-4k-instruct`) has been downloaded via the `foundry` CLI.

from foundry import FoundryLocal import os # Ensure the Foundry Local runtime is installed and running. # For example, download the 'phi3-mini-4k-instruct' model via the Foundry Local CLI: # foundry download phi3-mini-4k-instruct try: client = FoundryLocal() # You might need to explicitly download a model if not already present. # client.download_model("phi3-mini-4k-instruct") # Uncomment and run once if needed print("FoundryLocal client initialized. Attempting chat completion...") response = client.chat.completions.create( model="phi3-mini-4k-instruct", # Replace with a model you have downloaded messages=[ {"role": "user", "content": "What is the capital of France?"} ], max_tokens=50 ) print("Response:", response.choices[0].message.content) except Exception as e: print(f"An error occurred: {e}") print("Please ensure the Foundry Local runtime is installed, running, and the specified model is downloaded.")
Debug
Known issues
gotchaThe `foundry-local-sdk` Python library is a client to the Foundry Local runtime. It requires the Foundry Local application/service to be installed and running on your system for any API calls to function.
fix
Install the Foundry Local runtime from official Microsoft sources and ensure it's running before using the Python SDK. Check its status via the `foundry` CLI.
affects: All versions
gotchaModels used with the SDK must be downloaded to your local Foundry Local instance. Attempting to use a model that hasn't been downloaded will result in a `ModelNotFoundError`.
fix
Use the `foundry download <model_name>` CLI command or `client.download_model(<model_name>)` in the SDK to fetch the desired model before attempting inference.
affects: All versions
gotchaEarly versions (pre-1.0.0, e.g., v0.8.113) had a limitation of supporting only one tool call per request. While this might be improved in newer versions, be aware of potential limitations with complex tool-calling scenarios.
fix
Refer to the latest Foundry Local documentation for current tool-calling capabilities and limitations. For older versions, simplify tool_choice to ensure only one tool is invoked.
affects: <1.0.0
gotchaSome users experienced issues with tool calling on NVIDIA GPUs with older Foundry Local runtime versions (e.g., v0.8.117). This indicates potential hardware-specific runtime bugs.
fix
Ensure your Foundry Local runtime and SDK are updated to the latest available version, as many such issues are resolved in subsequent releases. Check official release notes for hardware-specific fixes.
affects: <1.0.0
Upgrade
Version history
1.2.3latest on PyPI · released Jun 12, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
foundry-local-sdk — pip install foundry-local-sdk · libregistry