Skip to content

feat(libsy): expose Python target bindings#89

Open
nachiketb-nvidia wants to merge 1 commit into
nachiketb/libsy-python-protocol-bindingsfrom
nachiketb/libsy-python-target-bindings
Open

feat(libsy): expose Python target bindings#89
nachiketb-nvidia wants to merge 1 commit into
nachiketb/libsy-python-protocol-bindingsfrom
nachiketb/libsy-python-target-bindings

Conversation

@nachiketb-nvidia

@nachiketb-nvidia nachiketb-nvidia commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Stack

  1. feat(libsy): expose typed Python protocol bindings #88 Protocol bindings
  2. feat(libsy): expose Python target bindings #89 Target bindings (this PR)
  3. feat(libsy): expose Python algorithm execution #87 Algorithm execution
  4. feat(libsy): expose Python run streams #82 Host-driven run streams

Review after #88.

Why

Python needs a reusable way to describe the semantic targets consumed by Rust-owned routing algorithms without binding any algorithm yet.

What

  • Bind LlmTarget and LlmTargetSet.
  • Keep llm_client assignable before an algorithm snapshots the target set.
  • Validate the presence of a callable call method.
  • Expose only the target API and its stubs.
  • Add focused target collection and mutation tests.

How

The Python objects retain target and client references. Conversion into Rust targets is deliberately added in the next PR, where algorithm execution first consumes them.

What to review

  1. Target naming and lookup behavior.
  2. Client assignment and validation.
  3. The snapshot boundary reserved for algorithm construction.
  4. Separation from the existing components LlmTarget.

Validation

  • cargo fmt --all -- --check
  • cargo clippy -p switchyard-py --all-targets -- -D warnings
  • uv run pytest tests/test_libsy_protocol_bindings.py tests/test_libsy_target_bindings.py -q -o addopts= (9 passed)

Signed-off-by: nachiketb <nachiketb@nvidia.com>
@nachiketb-nvidia
nachiketb-nvidia force-pushed the nachiketb/libsy-python-target-bindings branch from 469528f to b4d1641 Compare July 17, 2026 18:18
@nachiketb-nvidia
nachiketb-nvidia force-pushed the nachiketb/libsy-python-protocol-bindings branch from b383288 to b7c5507 Compare July 17, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant