class_docstr: Client for remote Megatron-LM server.
  
  This client expects an external Megatron-LM server to be run on localhost:5000. See the
  Megatron-LM respository for documentation on starting a Megatron text generation server:
  
  https://github.com/NVIDIA/Megatron-LM#gpt-text-generation
code: def _send_request(
      self, raw_request: Dict[str, Any]
  ) -> Dict[str, Any]:
      response = requests.request(
          method="PUT",
          # TODO(tgale): Make this configurable.
          url="http://localhost:5000/api",
          headers={
              "Content-Type": "application/json; charset=UTF-8",
          },
          data=json.dumps(raw_request),
      )
      out = json.loads(response.text)
  
      # Detect if the server returned an error string.
      if type(out) != dict:
          raise ValueError(f"{response}: {response.text}")
      return out
  
file_path: H2O/h2o_hf/helm/src/helm/proxy/clients/megatron_client.py
imports: import json
  import requests
  from typing import Any, Dict, List
  import traceback
  from helm.common.request import EMBEDDING_UNAVAILABLE_REQUEST_RESULT, Request, RequestResult, Sequence, Token
  from helm.common.tokenization_request import TokenizationRequest
  from helm.proxy.clients.huggingface_client import HuggingFaceClient
  from helm.proxy.clients.client import Client, wrap_request_time, truncate_sequence
label_desc: Use image node_id 1 for calling the MegatronClient obj's underlying member method code with example usage: obj._send_request(raw_request) and returns: out