Skip to content

Add gRPC server inference SSH example - #582

Merged
cretz merged 3 commits into
mainfrom
cretz/grpc-server-inference-ssh
Jul 28, 2026
Merged

Add gRPC server inference SSH example#582
cretz merged 3 commits into
mainfrom
cretz/grpc-server-inference-ssh

Conversation

@cretz

@cretz cretz commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What changed

  • New example follow-on from Add inference SSH tune-vllm-args example #581.
  • Full README.md walking through how to use it (manually tested).
  • Adds inference-ssh/grpc-server, an inference-SSH example that deploys a Python gRPC server and shows editing its code on a running replica and restarting it in place, no redeploy.
  • Server is a Greeter service plus the standard gRPC health check service (how Baseten judges gRPC health), packaged as grpc_greeter in a self-contained uv project under project/.
  • config.yaml runs it as an opaque docker_server over runtime.transport.kind: grpc on port 50051, CPU-only, with remote_ssh enabled: stock python:3.12-slim, external_package_dirs ships the project into /packages, uv sync --frozen --no-dev installs locked runtime deps editable, and entr restarts the server on any package-file change.
  • Includes committed protobuf stubs plus uv run grpc-greeter-codegen to regenerate them, and a uv run grpc-greeter-client that calls the deployed model over gRPC.
  • Links the new example from inference-ssh/README.md.

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

Adds a new inference-ssh/grpc-server example demonstrating an in-container edit/restart loop over SSH for a Python gRPC server on Baseten, including a walkthrough and a self-contained uv project with generated protobuf stubs.

Changes:

  • Add a new grpc-server inference-SSH example with full README walkthrough, Truss config.yaml, and a simple Greeter + gRPC health-check server.
  • Add a uv-managed Python project (grpc_greeter) including client, codegen script, and checked-in generated stubs.
  • Link the new example from the inference-ssh index README.

Reviewed changes

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

Show a summary per file
File Description
inference-ssh/README.md Adds link to the new grpc-server SSH dev-loop example.
inference-ssh/grpc-server/README.md Step-by-step deployment, calling, SSH editing, and restart walkthrough.
inference-ssh/grpc-server/config.yaml Truss config to run an opaque gRPC docker_server with remote_ssh and entr restarts.
inference-ssh/grpc-server/project/pyproject.toml Defines the uv project, runtime deps, and uv run scripts for client/codegen.
inference-ssh/grpc-server/project/uv.lock Locks Python dependencies for the example project.
inference-ssh/grpc-server/project/greeter.proto Proto contract for the Greeter service.
inference-ssh/grpc-server/project/src/grpc_greeter/init.py Package marker/docstring for grpc_greeter.
inference-ssh/grpc-server/project/src/grpc_greeter/server.py gRPC server implementation including gRPC health-check registration.
inference-ssh/grpc-server/project/src/grpc_greeter/client.py Client for calling the deployed model over gRPC with Baseten metadata.
inference-ssh/grpc-server/project/src/grpc_greeter/codegen.py Script to regenerate protobuf/gRPC Python stubs via grpc_tools.protoc.
inference-ssh/grpc-server/project/src/grpc_greeter/greeter_pb2.py Checked-in generated protobuf Python stub.
inference-ssh/grpc-server/project/src/grpc_greeter/greeter_pb2_grpc.py Checked-in generated gRPC Python stub.
Files not reviewed (1)
  • inference-ssh/grpc-server/project/src/grpc_greeter/greeter_pb2.py: Generated file

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

Comment thread inference-ssh/grpc-server/project/pyproject.toml Outdated
Comment thread inference-ssh/grpc-server/project/src/grpc_greeter/server.py Outdated
Comment thread inference-ssh/grpc-server/project/src/grpc_greeter/greeter_pb2_grpc.py Outdated
Comment thread inference-ssh/grpc-server/project/src/grpc_greeter/greeter_pb2.py


class GreeterServicer(greeter_pb2_grpc.GreeterServicer):
def SayHello(self, request, context):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: add request type, I assume this is HelloRequest?.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Annotations added

@@ -0,0 +1,117 @@
# gRPC server dev loop over SSH

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have already another SSH example. Is the point of this one to show how to do gRPC + SSH in combination specifically? Is SSH with gRPC different than with the vllm example? I'm a bit confused with of the two topics SSH and gRPC is the focus point of this one here .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is SSH with gRPC different than with the vllm example?

No, not much different and I agree it may not deserve its own sample, but this was an explicit request by @squidarth to be a separate sample regardless.

@cretz
cretz merged commit 8fdac17 into main Jul 28, 2026
2 checks passed
@cretz
cretz deleted the cretz/grpc-server-inference-ssh branch July 28, 2026 16:24
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.

3 participants