{"id":13695233,"url":"https://github.com/sausheong/goreplicate","last_synced_at":"2025-07-08T20:31:50.620Z","repository":{"id":66720175,"uuid":"535217454","full_name":"sausheong/goreplicate","owner":"sausheong","description":"This is a simple Go package for interacting with the Replicate (https://replicate.com) HTTP APIs. Replicate is an API service that allows developers to use machine learning models easily through calling APIs.","archived":false,"fork":false,"pushed_at":"2023-09-06T05:34:40.000Z","size":7,"stargazers_count":26,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T10:40:05.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/sausheong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-11T07:03:37.000Z","updated_at":"2024-11-22T16:40:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ff6dd89-1b11-45ec-a718-1e370948cb95","html_url":"https://github.com/sausheong/goreplicate","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sausheong/goreplicate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sausheong%2Fgoreplicate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sausheong%2Fgoreplicate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sausheong%2Fgoreplicate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sausheong%2Fgoreplicate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sausheong","download_url":"https://codeload.github.com/sausheong/goreplicate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sausheong%2Fgoreplicate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264343638,"owners_count":23593763,"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":[],"created_at":"2024-08-02T18:00:20.018Z","updated_at":"2025-07-08T20:31:50.374Z","avatar_url":"https://github.com/sausheong.png","language":"Go","funding_links":[],"categories":["Client libraries"],"sub_categories":[],"readme":"# Go Replicate\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/sausheong/goreplicate.svg)](https://pkg.go.dev/github.com/sausheong/goreplicate)\n\nThis is a simple Go package for interacting with the Replicate (https://replicate.com) HTTP APIs. Replicate is an API service that allows developers to use machine learning models easily through calling APIs.\n\nThis package is based on the HTTP APIs -- https://replicate.com/docs/reference/http. Please read the APIs to understand how it works first.\n\n## How to use\n\nFirst, create a model. Go to https://replicate.com/explore to find the model you want to use. Then set up the input parameters for the model.\n\n````go\nmodel := NewModel(\"stability-ai\", \"stable-diffusion\", version)\nmodel.Input[\"prompt\"] = \"An astronaut riding a horse in photorealistic style\"\nmodel.Input[\"num_outputs\"] = 4\n````\n\nThen create a client, passing into it the API authentication token (you can get it here once you registered an account -- https://replicate.com/account) and the model you just created.\n\nUsing the client you can send a create prediction call to the API to start the prediction.\n\n````go\nclient := NewClient(auth, model)\nerr := client.Create()\nif err != nil {\n    // resolve the error here\n}\n````\n\nThe client should have a `Response`, with an ID after calling the `Create` function. This is the prediction ID that you can use to retrieve the results of the prediction. At this point in time, the `Response` struct will have nothing in the `Output`\n\nTo get the results of the prediction, you can use the same client, or you can create a new client and call the `Get` function. This will return you the results of the prediction in the `Output`.\n\n````go\nerr := client.Get(predictId)\nif err != nil {\n    // resolve the error here\n}    \n````\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsausheong%2Fgoreplicate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsausheong%2Fgoreplicate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsausheong%2Fgoreplicate/lists"}