Foundry-Local icon indicating copy to clipboard operation
Foundry-Local copied to clipboard

FoundryLocalManager() keeps failing with 'Httpx client is not set. Please start the service first.' even though the service is running

Open jmopuri-Intel opened this issue 3 weeks ago • 1 comments

writing Python code to automate for testing using Foundry-local. used sample code provided in the documentation to try and I keep failing at : manager = FoundryLocalManager(alias)

output:------------------------------------------------------------------------------ 🟢 Service is already running on http://127.0.0.1:58338/. [foundry-local] | 2025-12-01 12:35:10 | WARNING | Foundry service did not start within the expected time. May not be running. Traceback (most recent call last): File "C:\Users\mrao\OneDrive - Intel Corporation\WIP\Learning\FoundryAI\Foundry2.py", line 10, in manager = FoundryLocalManager(alias) File "C:\Users\mrao\OneDrive - Intel Corporation\WIP\Learning\FoundryAI\Foundry_env\Lib\site-packages\foundry_local\api.py", line 48, in init self.download_model(alias_or_model_id, device=device) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\mrao\OneDrive - Intel Corporation\WIP\Learning\FoundryAI\Foundry_env\Lib\site-packages\foundry_local\api.py", line 312, in download_model model_info = self.get_model_info(alias_or_model_id, device=device, raise_on_not_found=True) File "C:\Users\mrao\OneDrive - Intel Corporation\WIP\Learning\FoundryAI\Foundry_env\Lib\site-packages\foundry_local\api.py", line 182, in get_model_info catalog = self.list_catalog_models() File "C:\Users\mrao\OneDrive - Intel Corporation\WIP\Learning\FoundryAI\Foundry_env\Lib\site-packages\foundry_local\api.py", line 136, in list_catalog_models FoundryModelInfo.from_list_response(model) for model in self.httpx_client.get("/foundry/list") ^^^^^^^^^^^^^^^^^ File "C:\Users\mrao\OneDrive - Intel Corporation\WIP\Learning\FoundryAI\Foundry_env\Lib\site-packages\foundry_local\api.py", line 88, in httpx_client raise RuntimeError("Httpx client is not set. Please start the service first.") RuntimeError: Httpx client is not set. Please start the service first.

jmopuri-Intel avatar Dec 01 '25 20:12 jmopuri-Intel

Hi @jmopuri-Intel, are you able to run the CLI to try to start the service manually? and then share logs so thay we can see what is happening. Also would you happen to be running on Windows Insider Preview? There are some known issues with downloading the EPs when running on certain Windows versions. There is extra guidance here: https://learn.microsoft.com/en-us/windows/ai/new-windows-ml/execution-provider-errors

natke avatar Dec 02 '25 00:12 natke