RepoBasetenBasetenpublished Jun 26, 2025seen 5d

basetenlabs/truss-grpc-example

Go

Open original ↗

Captured source

source ↗
published Jun 26, 2025seen 5dcaptured 8hhttp 200method plain

basetenlabs/truss-grpc-example

Language: Go

Stars: 0

Forks: 0

Open issues: 2

Created: 2025-06-26T20:07:46Z

Pushed: 2026-03-19T01:40:10Z

Default branch: main

Fork: no

Archived: no

README:

gRPC Truss Example

This project demonstrates a gRPC service using Truss for model deployment.

Prerequisites

  • Docker CLI installed
  • Go installed
  • Access to a container registry (Docker Hub, Google Container Registry, etc.)

Setup

Get the repository with:

git clone https://github.com/basetenlabs/truss-grpc-example.git

Install Truss with:

pip install --upgrade truss

Deployment

0. Generate Protobuf files

protoc --go_out=. --go-grpc_out=. example.proto

For more information about Protobuf, refer to the Protobuf documentation.

1. Build and Push Docker Image

First, build the Docker image using the provided Dockerfile:

docker build -t your-registry/truss-grpc-demo:latest . --platform linux/amd64
docker push your-registry/truss-grpc-demo:latest

2. Update Configuration

Update the config.yaml file to use your newly built image:

base_image:
image: your-registry/truss-grpc-demo:latest # Replace with your image
[...]

3. Push Model with Truss

Deploy your model using the Truss CLI:

truss push . --promote

For more detailed information about Truss deployment, refer to the truss push documentation.

4. Call the Model

Copy the model ID from the Baseten Models page into client/main.go as the modelID variable.

Copy the API key from the Baseten API keys page into client/main.go as the basetenApiKey variable.

Test the model by running the client:

go run client/main.go

Notability

notability 2.0/10

Routine example repo, no traction.