Add Agent Framework examples#110
Open
jsturtevant wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
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>
67eb5a6 to
109fa8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds local and remote Microsoft Agent Framework examples for Hyperlight Unikraft.
Summary: