Skip to main content

Client for the public Ginkgo AI API

Project description

Ginkgo's AI model API client

Work in progress: this repo was just made public and we are still working on integration

A python client for Ginkgo's AI model API, to run inference on public and Ginkgo-proprietary models. Learn more in the Model API announcement.

Prerequisites

Register at https://models.ginkgobioworks.ai/ to get credits and an API KEY (of the form xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx). Store the API KEY in the GINKGOAI_API_KEY environment variable.

Installation

Install the python client with pip:

pip install ginkgo-ai-client

Usage:

Note: This is an alpha version of the client and its interface may vary in the future.

Example : masked inference with Ginkgo's AA0 model

The client requires an API key (and defaults to os.environ.get("GINKGOAI_API_KEY") if none is explicitly provided)

from ginkgo_ai_client import GinkgoAIClient, aa0_masked_inference_params

client = GinkgoAIClient()
prediction = client.query(aa0_masked_inference_params("MPK<mask><mask>RRL"))
# prediction["sequence"] == "MPKYLRRL"

predictions = client.batch_query([
    aa0_masked_inference_params("MPK<mask><mask>RRL"),
    aa0_masked_inference_params("M<mask>RL"),
    aa0_masked_inference_params("MLLM<mask><mask>R"),
])
# predictions[0]["result"]["sequence"] == "MPKYLRRL"

Note that you can get esm predictions by using esm_masked_inference_params in the example above.

Example : embedding computation with Ginkgo's 3'UTR language model

from ginkgo_ai_client import GinkgoAIClient, three_utr_mean_embedding_params

client = GinkgoAIClient()
prediction = client.query(three_utr_mean_embedding_params("ATTGCG"))
# prediction["embedding"] == [1.05, -2.34, ...]

predictions = client.batch_query([
    three_utr_mean_embedding_params("ATTGCG"),
    three_utr_mean_embedding_params("CAATGC"),
    three_utr_mean_embedding_params("GCGCACATGT"),
])
# predictions[0]["result"]["embedding"] == [1.05, -2.34, ...]

Available models

See the example folder and reference docs for more details on usage and parameters.

Model Description Reference Supported queries Versions
ESM2 Large Protein language model from Meta Github Embeddings, masked inference 3B, 650M
AA0 Ginkgo's proprietary protein language model Announcement Embeddings, masked inference 650M
3UTR Ginkgo's proprietary 3'UTR language model Preprint Embeddings, masked inference 650M

License

This project is licensed under the MIT License. See the LICENSE file for details.

Releases

Make sure the changelog is up to date, increment the version in pyproject.toml, create a new tag, then run the pubish action on that new tag (automation is coming soon).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ginkgo_ai_client-0.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

ginkgo_ai_client-0.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file ginkgo_ai_client-0.1.0.tar.gz.

File metadata

  • Download URL: ginkgo_ai_client-0.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ginkgo_ai_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2bf430f82ffdecb62d90ba703d26ca1f6458a0170544cd59bf21fd9a43b18cd8
MD5 e2f2068ae08725a4759fe9465e8e50be
BLAKE2b-256 efd76896bbc3f65867b99910f9269fa55f19581f53c38aaea2c6d4ba4cfdeb42

See more details on using hashes here.

Provenance

The following attestation bundles were made for ginkgo_ai_client-0.1.0.tar.gz:

Publisher: publish.yml on ginkgobioworks/ginkgo-ai-client

Attestations:

File details

Details for the file ginkgo_ai_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ginkgo_ai_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dfabdd53fe7ad3dcf0fbada5ff0042966e9666ecf53fd1f657c8c0a6de1258bc
MD5 974950369b8570ae42d54efa5eb962c1
BLAKE2b-256 54ee37643138bc329eb7b751acb0fd284641026c2b713eb35051eff8afb0ee08

See more details on using hashes here.

Provenance

The following attestation bundles were made for ginkgo_ai_client-0.1.0-py3-none-any.whl:

Publisher: publish.yml on ginkgobioworks/ginkgo-ai-client

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page