feat(examples/strands_sglang): update to strands-sglang 0.4.2#2106
Open
Lawhy wants to merge 1 commit into
Open
feat(examples/strands_sglang): update to strands-sglang 0.4.2#2106Lawhy wants to merge 1 commit into
Lawhy wants to merge 1 commit into
Conversation
Migrate the example to the strands-sglang 0.4.2 API: - Read the token trajectory via the new `model.rollout` (`Rollout`) API instead of the removed `model.token_manager` (`initial_prompt_length`, `token_ids`/`loss_mask`/`logprobs`). - Use a self-contained `subprocess_interpreter.py` for the `execute_python_code` tool, keeping the example dependency-light. - Drop the one-line `requirements.txt` (the only extra dep is `strands-sglang`, installed directly) and refresh the README accordingly.
Contributor
Author
|
Hi @yitianlian, can you take a look when you have time? This is a simple adaption to the most recent |
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.
What
Updates the
examples/strands_sglangexample to the latest strands-sglang 0.4.2 API.Changes
model.rollout(Rollout) tracker instead of the removedmodel.token_manager:initial_prompt_lengthfor the prompt boundary, plustoken_ids/loss_mask/logprobs.execute_python_codetool now uses an in-examplesubprocess_interpreter.py, keeping the example dependency-light.requirements.txt(the only extra dependency isstrands-sglang, installed directly) and refresh the README install steps.loss_mask/Rolloutwording and add a security note that the interpreter runs code with no isolation.Testing
pre-commit run --files ...(ruff, autoflake, isort, black + file checks) passes on all changed files.python -m py_compilepasses; the 0.4.2model.rolloutslicing was verified against the installedstrands-sglang==0.4.2+strands-agents==1.26.0.