Registry / http-networking / smg-grpc-proto

smg-grpc-proto

JSON →
library0.4.10pypypi✓ verified 83d ago

smg-grpc-proto provides the Protocol Buffer definitions and generated Python gRPC stubs for the Shepherd Model Gateway (SMG). These definitions enable communication with SMG, a universal gateway supporting various LLM inference engines like SGLang, vLLM, and TRT-LLM. While the main SMG project undergoes rapid development (currently v1.4.x), this library provides the stable API surface for gRPC interaction. The current version is 0.4.6, with updates typically tied to major SMG feature releases.

pip install smg-grpc-proto
INSTALL
IMPORT
SIG · SMG-GRPC-PROTO
S
smg-grpc-proto
http-networkingpythonv0.4.10
Install
2.7s avg
Import
Disk
37MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 3.33s
py 3.11
✓ —
✓ 2.8s
py 3.12
✓ —
✓ 2.35s
py 3.13
✓ —
✓ 2.48s
py 3.9
✕ build_error
✕ build_error
37MB installed
● package 37MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mlx_engine_pb2
from smg_grpc_proto import mlx_engine_pb2
from smg_proto import smg_pb2
vllm_engine_pb2
from smg_grpc_proto import vllm_engine_pb2
sglang_scheduler_pb2
from smg_grpc_proto import sglang_scheduler_pb2

This quickstart demonstrates how to use the generated gRPC stubs from `smg-grpc-proto` to make a `CompletionRequest` to a running Shepherd Model Gateway. It establishes an insecure channel, creates a stub, and sends a request. Remember to replace '<your_model_name>' with a model available on your SMG instance. An SMG gateway must be running and accessible at `SMG_GRPC_TARGET` (defaults to `localhost:8000`) for this example to work.

import grpc from smg_proto import smg_pb2, smg_pb2_grpc import os # NOTE: This example requires a running SMG gateway to connect to. # For a local gateway, use 'localhost:8000' (default). SMG_GRPC_TARGET = os.environ.get('SMG_GRPC_TARGET', 'localhost:8000') def run_completion_client(): try: with grpc.insecure_channel(SMG_GRPC_TARGET) as channel: stub = smg_pb2_grpc.CompletionServiceStub(channel) request = smg_pb2.CompletionRequest( model='<your_model_name>', # e.g., 'mistral-7b-instruct-v0.2' prompt='Hello, world! What is your name?', max_tokens=50, temperature=0.7 ) print(f"Sending completion request to {SMG_GRPC_TARGET}...") response = stub.Complete(request) print("Completion Response:") print(f"Text: {response.text}") if response.finish_reason: print(f"Finish Reason: {response.finish_reason}") print(f"Prompt Tokens: {response.prompt_tokens}") print(f"Completion Tokens: {response.completion_tokens}") except grpc.RpcError as e: print(f"gRPC Error: {e.code()} - {e.details()}") except Exception as e: print(f"An unexpected error occurred: {e}") if __name__ == '__main__': run_completion_client()
Debug
Known issues
gotchaThis package (`smg-grpc-proto`) provides only the Protocol Buffer definitions and generated Python gRPC client/server stubs. It does not include the full Shepherd Model Gateway client SDK or the gateway server itself. For a higher-level client, consider `smg-client-sdk`.
fix
If you need a full client library with convenience methods, use `pip install smg-client-sdk`. If you are building a custom gRPC client/server, this package is appropriate.
affects: All
breakingSignificant changes to the SMG gateway's API (e.g., new services, modified message structures for features like Multimodal or Messages API) often lead to updates in `smg-grpc-proto`. Using an older `smg-grpc-proto` version with a newer SMG gateway (or vice versa) can result in gRPC errors like `UNIMPLEMENTED`, `INVALID_ARGUMENT`, or malformed responses.
fix
Always align the `smg-grpc-proto` version with the expected version of the SMG gateway you are interacting with. Consult the SMG gateway's release notes for compatible proto versions. Upgrade `smg-grpc-proto` to the latest version to ensure compatibility with the most recent SMG gateway features and fixes: `pip install --upgrade smg-grpc-proto`.
affects: 0.1.x - 0.4.x (especially with SMG gateway versions 1.x.x)
gotchaThe generated Python package for the proto definitions is `smg_proto`, not `smg_grpc_proto`. Direct imports should use `from smg_proto import ...`.
fix
When importing, always refer to the `smg_proto` module, e.g., `from smg_proto import smg_pb2, smg_pb2_grpc`.
affects: All
Upgrade
Version history
0.4.10latest on PyPI · released Jun 11, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
smg-grpc-proto — pip install smg-grpc-proto · libregistry