-
Notifications
You must be signed in to change notification settings - Fork 35
[vllm #23386]update recipe with container tool #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @morgendave, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request updates the gpt-oss
vLLM usage guide by introducing detailed documentation for the new container
tool. This tool enables the execution of command-line operations within a stateful Docker container, enhancing the model's capabilities for tool use. The update also includes minor formatting adjustments for improved readability.
Highlights
- New Tool Documentation: Documented the "container" tool for GPT OSS, which facilitates running command-line tools in a stateful Docker environment.
- Container Tool Function Signature: Provided the expected signature for the "exec" function within the "container" tool, including its arguments like cmd, workdir, env, session_name, timeout, and user.
- Tool Activation Instructions: Explained how to enable the "container" tool by setting the VLLM_ENABLE_CONTAINER_TOOL environment variable.
- Documentation Formatting: Applied minor whitespace corrections across the document for consistency.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the gpt-oss
recipe by removing trailing whitespaces and adding documentation for the container
tool. The changes are good, but I've provided a few suggestions to improve the clarity and grammatical correctness of the newly added documentation section to make it easier for users to understand.
OpenAI/GPT-OSS.md
Outdated
The URLs are expected to be MCP SSE servers that implement `instructions` in server info and well documented tools. The tools will be injected into the system prompt for the model to enable them. | ||
The URLs are expected to be MCP SSE servers that implement `instructions` in server info and well documented tools. The tools will be injected into the system prompt for the model to enable them. | ||
|
||
GPT OSS also expects a builtin tool called container. It doesn't have exposed tool type in openai types. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better readability and to follow standard English grammar, 'builtin' should be hyphenated to 'built-in' when used as an adjective.
GPT OSS also expects a builtin tool called container. It doesn't have exposed tool type in openai types. | |
GPT OSS also expects a built-in tool called container. It doesn't have exposed tool type in openai types. |
OpenAI/GPT-OSS.md
Outdated
GPT OSS also expects a builtin tool called container. It doesn't have exposed tool type in openai types. | ||
For reference the container tool is a stateful docker container that can be used to run command line tools. | ||
The enabled tool namespace is `container` and the tool name used the most is `exec`. | ||
MCP server need to implement the following functions to support container tool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a minor grammatical error here. Since 'MCP server' is a singular subject, the verb should be 'needs' instead of 'need'.
MCP server need to implement the following functions to support container tool: | |
MCP server needs to implement the following functions to support container tool: |
OpenAI/GPT-OSS.md
Outdated
- for tool name: exec | ||
- args: | ||
{ | ||
"cmd":List[str] "command to execute", | ||
"workdir":optional[str] "current working directory", | ||
"env":optional[object/dict] "environment variables", | ||
"session_name":optional[str] "session name", | ||
"timeout":optional[int] "timeout in seconds", | ||
"user":optional[str] "user name", | ||
} | ||
Signature: | ||
async def exec(ctx: Context, rest_of_the_args) -> str | ||
expect ctx to contain a session id to identify the container session and make it stateful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current format for describing the exec
tool's arguments and signature is a bit difficult to read. The use of curly braces suggests a JSON object, but the content is not valid JSON, which can be confusing. I suggest refactoring this block to a simpler, more standard format for clarity. This will make it easier for developers to understand the required implementation.
- for tool name: exec | |
- args: | |
{ | |
"cmd":List[str] "command to execute", | |
"workdir":optional[str] "current working directory", | |
"env":optional[object/dict] "environment variables", | |
"session_name":optional[str] "session name", | |
"timeout":optional[int] "timeout in seconds", | |
"user":optional[str] "user name", | |
} | |
Signature: | |
async def exec(ctx: Context, rest_of_the_args) -> str | |
expect ctx to contain a session id to identify the container session and make it stateful | |
Tool: exec | |
Arguments: | |
- cmd (List[str]): command to execute | |
- workdir (Optional[str]): current working directory | |
- env (Optional[Dict[str, str]]): environment variables | |
- session_name (Optional[str]): session name | |
- timeout (Optional[int]): timeout in seconds | |
- user (Optional[str]): user name | |
Signature: | |
async def exec(ctx: Context, **kwargs) -> str | |
# Note: `ctx` is expected to contain a session id to identify the container session and make it stateful. |
async def exec(ctx: Context, rest_of_the_args) -> str | ||
expect ctx to contain a session id to identify the container session and make it stateful | ||
``` | ||
Container tool runtime implementation can be referenced from https://github.com/SWE-agent/SWE-ReX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give a series of commands to setup the SWE MCP server and run vllm with this MCP server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have a standalone MCP server but it should be the same as any MCP server to run standalone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean some instructions similar to the python & browser mcp server:
use (https://github.com/openai/gpt-oss/tree/main/gpt-oss-mcp-server and run
mcp run -t sse browser_server.py:mcp
mcp run -t sse python_server.py:mcp
vllm serve ... --tool-server ip-1:port-1,ip-2:port-2
Can you also explain |
ec21634
to
8ba65aa
Compare
``` | ||
from mcp.server.fastmcp import fastmcp | ||
# dummy showing how to import container tool | ||
from swe_rex import SweRexManager |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to use https://github.com/SWE-agent/SWE-ReX to build this SweRexManager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to just drop this as python script here and link it with gh link
This adds descriptions for #23386