Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sdk/js/src/detail/coreInterop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ koffi.struct('StreamingRequestBuffer', {
BinaryDataLength: 'int32_t',
});

const CallbackType = koffi.proto('void CallbackType(void *data, int32_t length, void *userData)');
const CallbackType = koffi.proto('int32_t CallbackType(void *data, int32_t length, void *userData)');

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down Expand Up @@ -200,6 +200,7 @@ export class CoreInterop {
const cb = koffi.register((data: any, length: number, userData: any) => {
const chunk = koffi.decode(data, 'char', length);
callback(chunk);
return 0; // 0 = continue, 1 = cancel
}, koffi.pointer(CallbackType));

return new Promise<string>((resolve, reject) => {
Expand Down
8 changes: 5 additions & 3 deletions sdk/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ pydantic>=2.0.0
requests>=2.32.4
openai>=2.24.0
# Standard native binary packages from the ORT-Nightly PyPI feed.
foundry-local-core==0.9.0.dev20260327060216
onnxruntime-core==1.24.3
onnxruntime-genai-core==0.12.1
foundry-local-core==1.0.0-rc1
onnxruntime-core==1.24.3; sys_platform != "linux"
onnxruntime-gpu==1.24.3; sys_platform == "linux"
onnxruntime-genai-core==0.12.1; sys_platform != "linux"
onnxruntime-genai-cuda==0.12.1; sys_platform == "linux"
4 changes: 3 additions & 1 deletion sdk/python/src/detail/model_data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# --------------------------------------------------------------------------

from typing import Optional, List
from pydantic import BaseModel, Field
from pydantic import BaseModel, ConfigDict, Field

from enum import StrEnum

Expand Down Expand Up @@ -53,6 +53,8 @@ class ModelInfo(BaseModel):
Fields are populated from the JSON response of the ``get_model_list`` command.
"""

model_config = ConfigDict(protected_namespaces=())

id: str = Field(alias="id", description="Unique identifier of the model. Generally <name>:<version>")
name: str = Field(alias="name", description="Model variant name")
version: int = Field(alias="version")
Expand Down
31 changes: 26 additions & 5 deletions sdk/python/src/detail/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,18 @@ def get_native_binary_paths() -> NativeBinaryPaths | None:

# Probe WinML packages first; fall back to standard if not installed.
core_path = _find_file_in_package("foundry-local-core-winml", core_name) or _find_file_in_package("foundry-local-core", core_name)
ort_path = _find_file_in_package("onnxruntime-core", ort_name)
genai_path = _find_file_in_package("onnxruntime-genai-core", genai_name)

# On Linux, ORT is shipped by onnxruntime-gpu (libonnxruntime.so in capi/).
if sys.platform.startswith("linux"):
ort_path = _find_file_in_package("onnxruntime", ort_name) or _find_file_in_package("onnxruntime-core", ort_name)
else:
ort_path = _find_file_in_package("onnxruntime-core", ort_name)

# On Linux, ORTGenAI is shipped by onnxruntime-genai-cuda (libonnxruntime.so in capi/).
if sys.platform.startswith("linux"):
genai_path = _find_file_in_package("onnxruntime-genai", genai_name) or _find_file_in_package("onnxruntime-genai-core", genai_name)
else:
genai_path = _find_file_in_package("onnxruntime-genai-core", genai_name)

if core_path and ort_path and genai_path:
return NativeBinaryPaths(core=core_path, ort=ort_path, genai=genai_path)
Expand Down Expand Up @@ -254,6 +264,9 @@ def foundry_local_install(args: list[str] | None = None) -> None:
if parsed.winml:
variant = "WinML"
packages = ["foundry-local-core-winml", "onnxruntime-core", "onnxruntime-genai-core"]
elif sys.platform.startswith("linux"):
variant = "Linux (GPU)"
packages = ["foundry-local-core", "onnxruntime-gpu", "onnxruntime-genai-core"]
else:
variant = "standard"
packages = ["foundry-local-core", "onnxruntime-core", "onnxruntime-genai-core"]
Expand All @@ -271,10 +284,18 @@ def foundry_local_install(args: list[str] | None = None) -> None:
else:
if _find_file_in_package("foundry-local-core", core_name) is None:
missing.append("foundry-local-core")
if _find_file_in_package("onnxruntime-core", ort_name) is None:
if sys.platform.startswith("linux"):
if _find_file_in_package("onnxruntime", ort_name) is None:
missing.append("onnxruntime-gpu")
else:
if _find_file_in_package("onnxruntime-core", ort_name) is None:
missing.append("onnxruntime-core")
if _find_file_in_package("onnxruntime-genai-core", genai_name) is None:
missing.append("onnxruntime-genai-core")
if sys.platform.startswith("linux"):
if _find_file_in_package("onnxruntime-genai", genai_name) is None:
missing.append("onnxruntime-genai-cuda")
else:
if _find_file_in_package("onnxruntime-genai-core", genai_name) is None:
missing.append("onnxruntime-genai-core")
print(
"[foundry-local] ERROR: Could not locate native binaries after installation. "
f"Missing: {', '.join(missing)}",
Expand Down
Loading