Skip to content

Add Agent Framework examples#110

Open
jsturtevant wants to merge 1 commit into
hyperlight-dev:mainfrom
jsturtevant:agent-framework-examples
Open

Add Agent Framework examples#110
jsturtevant wants to merge 1 commit into
hyperlight-dev:mainfrom
jsturtevant:agent-framework-examples

Conversation

@jsturtevant

Copy link
Copy Markdown

Adds local and remote Microsoft Agent Framework examples for Hyperlight Unikraft.

Summary:

  • Add offline local inference example using llama-cpp-python.
  • Add remote GitHub Models example.
  • Add pyhl env forwarding and a Python dev base stage for building native deps.

Copilot AI review requested due to automatic review settings July 9, 2026 00:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two end-to-end Microsoft Agent Framework examples (one fully offline, one using GitHub Models remotely) and extends the pyhl runner to support forwarding environment variables into the guest Python process. It also refactors the Python runtime Dockerfile to expose a reusable “python-dev” stage for building native dependencies against the same ABI as the shipped Python base image.

Changes:

  • Add pyhl run --env NAME[=VALUE] support to inject/forward environment variables into the guest Python process, with unit tests.
  • Add a remote Agent Framework example that calls GitHub Models from inside the micro-VM (network restricted via --net-allow), with a minimal initrd builder.
  • Add a local/offline Agent Framework example using llama-cpp-python + a baked-in GGUF model, including a matching Python dev base build flow for native deps.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
runtimes/python.Dockerfile Introduces a python-dev stage and ensures shared-library cache is refreshed after Python install for dev-image usability.
host/src/bin/pyhl.rs Adds --env parsing + injection prelude for guest Python, plus unit tests.
examples/agent-framework-remote/README.md Documents the remote GitHub Models Agent Framework example and its pyhl/networking flow.
examples/agent-framework-remote/Justfile Adds build/rootfs/setup/run automation for the remote example using the driver/pyhl stack.
examples/agent-framework-remote/Dockerfile Builds a minimal initrd: shipped hl_pydriver + agent-framework-core + cert/DNS config, packed as CPIO.
examples/agent-framework-remote/agent.py Implements a synchronous BaseChatClient that POSTs to GitHub Models (OpenAI-compatible) from inside the guest.
examples/agent-framework-remote/.gitignore Ignores generated kernels/initrds and local pyhl state for the remote example.
examples/agent-framework-local/README.md Documents fully offline inference with llama-cpp-python and the rationale for build/runtime constraints.
examples/agent-framework-local/Justfile Adds build/rootfs/run automation for the local offline example, including local Python base image build targets.
examples/agent-framework-local/Dockerfile Builds an initrd containing agent-framework-core, llama-cpp-python (built SSE-only), and a downloaded GGUF model.
examples/agent-framework-local/agent.py Implements a local llama.cpp-backed BaseChatClient plus stdlib stubs needed for the trimmed Python base.
examples/agent-framework-local/.gitignore Ignores generated kernels/initrds for the local example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
@jsturtevant jsturtevant force-pushed the agent-framework-examples branch from 67eb5a6 to 109fa8d Compare July 9, 2026 16:13
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.

2 participants