{"library":"smg-grpc-proto","title":"SMG gRPC Proto Definitions","type":"library","description":"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.","language":"python","status":"active","last_verified":"Sat May 16","install":{"commands":["pip install smg-grpc-proto"],"cli":null},"imports":["from smg_proto import smg_pb2","from smg_proto import smg_pb2_grpc","from smg_proto.smg_pb2 import CompletionRequest","from smg_proto.smg_pb2_grpc import CompletionServiceStub"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":"https://shepherd-model-gateway.readthedocs.io","github":"https://github.com/lightseekorg/smg","docs":null,"changelog":null,"pypi":"https://pypi.org/project/smg-grpc-proto/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import grpc\nfrom smg_proto import smg_pb2, smg_pb2_grpc\nimport os\n\n# NOTE: This example requires a running SMG gateway to connect to.\n# For a local gateway, use 'localhost:8000' (default).\nSMG_GRPC_TARGET = os.environ.get('SMG_GRPC_TARGET', 'localhost:8000')\n\ndef run_completion_client():\n    try:\n        with grpc.insecure_channel(SMG_GRPC_TARGET) as channel:\n            stub = smg_pb2_grpc.CompletionServiceStub(channel)\n            request = smg_pb2.CompletionRequest(\n                model='<your_model_name>',  # e.g., 'mistral-7b-instruct-v0.2'\n                prompt='Hello, world! What is your name?',\n                max_tokens=50,\n                temperature=0.7\n            )\n            print(f\"Sending completion request to {SMG_GRPC_TARGET}...\")\n            response = stub.Complete(request)\n            print(\"Completion Response:\")\n            print(f\"Text: {response.text}\")\n            if response.finish_reason:\n                print(f\"Finish Reason: {response.finish_reason}\")\n            print(f\"Prompt Tokens: {response.prompt_tokens}\")\n            print(f\"Completion Tokens: {response.completion_tokens}\")\n    except grpc.RpcError as e:\n        print(f\"gRPC Error: {e.code()} - {e.details()}\")\n    except Exception as e:\n        print(f\"An unexpected error occurred: {e}\")\n\nif __name__ == '__main__':\n    run_completion_client()","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-16","installed_version":"0.4.7","pypi_latest":"0.4.7","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":80,"avg_install_s":2.6,"avg_import_s":null,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"smg-grpc-proto","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"40.3M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"smg-grpc-proto","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":3.2,"import_time_s":null,"mem_mb":null,"disk_size":"38M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"smg-grpc-proto","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"42.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"smg-grpc-proto","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.7,"import_time_s":null,"mem_mb":null,"disk_size":"41M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"smg-grpc-proto","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"34.7M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"smg-grpc-proto","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.3,"import_time_s":null,"mem_mb":null,"disk_size":"33M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"smg-grpc-proto","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"34.4M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"smg-grpc-proto","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"broken","install_time_s":2.4,"import_time_s":null,"mem_mb":null,"disk_size":"32M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"smg-grpc-proto","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"smg-grpc-proto","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":1.6,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}