{"id":26399198,"url":"https://github.com/dideler/ex_aws_sagemaker_runtime","last_synced_at":"2025-07-15T19:40:21.252Z","repository":{"id":62429049,"uuid":"267568455","full_name":"dideler/ex_aws_sagemaker_runtime","owner":"dideler","description":"ExAws package for the AWS SageMaker Runtime service","archived":false,"fork":false,"pushed_at":"2020-05-28T11:52:47.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-21T20:12:28.083Z","etag":null,"topics":["aws","elixir","ex-aws","sagemaker","sagemaker-runtime"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/ex_aws_sagemaker_runtime","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dideler.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-28T11:11:04.000Z","updated_at":"2023-01-25T02:25:17.000Z","dependencies_parsed_at":"2022-11-01T20:02:17.948Z","dependency_job_id":null,"html_url":"https://github.com/dideler/ex_aws_sagemaker_runtime","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dideler/ex_aws_sagemaker_runtime","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dideler%2Fex_aws_sagemaker_runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dideler%2Fex_aws_sagemaker_runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dideler%2Fex_aws_sagemaker_runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dideler%2Fex_aws_sagemaker_runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dideler","download_url":"https://codeload.github.com/dideler/ex_aws_sagemaker_runtime/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dideler%2Fex_aws_sagemaker_runtime/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260654616,"owners_count":23042670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","elixir","ex-aws","sagemaker","sagemaker-runtime"],"created_at":"2025-03-17T13:18:56.849Z","updated_at":"2025-06-19T00:03:09.121Z","avatar_url":"https://github.com/dideler.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExAws.SageMakerRuntime\n\n[![Hex.pm](https://img.shields.io/hexpm/v/ex_aws_sagemaker_runtime.svg)](https://hex.pm/packages/ex_aws_sagemaker_runtime)\n[![Build Docs](https://img.shields.io/badge/hexdocs-release-blue.svg)](https://hexdocs.pm/ex_aws_sagemaker_runtime/ExAws.html)\n\n\n[ExAws](https://github.com/ex-aws/ex_aws) service for [AWS SageMaker Runtime](https://docs.aws.amazon.com/sagemaker/latest/dg/API_Operations_Amazon_SageMaker_Runtime.html).\n\nUse it for inference with models deployed on SageMaker.\n\n## API Coverage\n\n- [InvokeEndpoint](https://docs.aws.amazon.com/sagemaker/latest/dg/API_runtime_InvokeEndpoint.html)\n\n## Installation\n\nAdd the `ex_aws_sagemaker_runtime` service package to your list of dependencies in `mix.exs`.  \nIt depends on the `ex_aws` core package. It's recommended to make it an explicit dependency.  \nYou'll also need a compatible HTTP client (`ex_aws` defaults to `hackney`).\n\n\n```elixir\ndef deps do\n  [\n    {:ex_aws, \"~\u003e 2.1\"},\n    {:ex_aws_sagemaker_runtime, \"~\u003e 1.0\"},\n    {:hackney, \"~\u003e 1.15\"},\n  ]\nend\n```\n\n## Configuration\n\n`ExAws.SageMakerRuntime` is configured through `ExAws`. See the documentation for `ExAws`\nfor configuring access credentials, region, HTTP client, and so on.\n\nHere is a basic example configuration that could go in your `config/{config,dev,test,prod}.exs`.\n```elixir\nconfig :ex_aws, :sagemaker_runtime,\n  debug_requests: true,\n  region: \"eu-west-1\",\n  access_key_id: [{:system, \"AWS_ACCESS_KEY_ID\"}, :instance_role],\n  secret_access_key: [{:system, \"AWS_SECRET_ACCESS_KEY\"}, :instance_role]\n```\n\n## Usage\n\nAll SageMaker Runtime API actions need to call [`ExAws.request/2`](https://hexdocs.pm/ex_aws/ExAws.html#request/2).\n```elixir\nDataScience.ExAws.SageMakerRuntime.invoke_endpoint(\"my-model\", %{query: \"some-query})\n|\u003e ExAws.request()\n```\n\nA more realistic example that depends on Hackney as the underlying HTTP client and Poison for JSON.  \nThis example uses a function callback to handle the response body, which might be handy\nwhen your models return their data differently.\n\n```elixir\ndefmodule DataScience.Client do\n  @moduledoc \"\"\"\n  Wrapper around HTTP requests to AWS SageMaker Runtime.\n  \"\"\"\n\n  def request(endpoint, payload, opts \\\\ []) do\n    success_handler = Keyword.get(opts, :on_success, fn body -\u003e body end)\n\n    response =\n      ExAws.SageMakerRuntime.invoke_endpoint(endpoint, payload)\n      |\u003e ExAws.request()\n\n    case response do\n      {:ok, body} -\u003e\n        success_handler.(body)\n\n      {:error, {:http_error, _code, %{body: body, status_code: code}}} -\u003e\n        {:error, %{code: code, reason: Poison.decode!(body)}}\n\n      error -\u003e\n        error\n    end\n  end\nend\n```\n\n## SageMaker Runtime vs SageMaker\n\n[Amazon SageMaker](https://aws.amazon.com/sagemaker/) is marketed as a single product, but it consists of multiple AWS APIs.\n\nThere is the [SageMaker Runtime API][] and the [SageMaker API][].\n\nSageMaker Runtime can be used to make inference requests against models hosted with SageMaker.\n\nFor example, you've got your own inference code and want to host it on SageMaker. You'll need to\n[package your inference code in a Docker image and provide an HTTP API to handle the incoming requests](https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html).\nYou would use SageMaker Runtime to invoke the authenticated HTTP endpoint for your model(s) hosted on SageMaker.\n\n[SageMaker Runtime API]: https://docs.aws.amazon.com/sagemaker/latest/dg/API_Operations_Amazon_SageMaker_Runtime.html\n[SageMaker API]: https://docs.aws.amazon.com/sagemaker/latest/dg/API_Operations_Amazon_SageMaker_Service.html","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdideler%2Fex_aws_sagemaker_runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdideler%2Fex_aws_sagemaker_runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdideler%2Fex_aws_sagemaker_runtime/lists"}