Skip to main content

Python client for the ingrain server

Project description

Ingrain Python Client

PyPI Version Test Status

This is the Python client for the Ingrain API. It provides a simple interface to interact with the Ingrain API.

Install

pip install ingrain

Dev Setup

uv sync --dev

Testing

Unit tests

uv run pytest

Integration tests and unit tests

This requires that Ingrain Server is running. You can start it with Docker Compose:

services:
  ingrain-models:
    image: owenpelliott/ingrain-models:latest
    container_name: ingrain-models
    ports:
      - "8687:8687"
    environment:
      - TRITON_GRPC_URL=triton:8001
      - MAX_BATCH_SIZE=16
      - MODEL_INSTANCES=1
      - INSTANCE_KIND=KIND_GPU # Change to KIND_CPU if using a CPU
    depends_on:
      - triton
    volumes:
      - ./model_repository:/app/model_repository 
      - ${HOME}/.cache/huggingface:/app/model_cache/
  ingrain-inference:
    image: owenpelliott/ingrain-inference:latest
    container_name: ingrain-inference
    ports:
      - "8686:8686"
    environment:
      - TRITON_GRPC_URL=triton:8001
    depends_on:
      - triton
    volumes:
      - ./model_repository:/app/model_repository 
  triton:
    image: nvcr.io/nvidia/tritonserver:25.06-py3
    container_name: triton
    runtime: nvidia # Remove if using a CPU
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
    shm_size: "256m"
    command: >
      tritonserver
      --model-repository=/models
      --model-control-mode=explicit
    ports:
      - "8000:8000"
      - "8001:8001"
      - "8002:8002"
    volumes:
      - ./model_repository:/models
    restart:
      unless-stopped
uv run pytest --integration

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

ingrain-0.2.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ingrain-0.2.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ingrain-0.2.1.tar.gz.

File metadata

  • Download URL: ingrain-0.2.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ingrain-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d8622c3b75b7fa23788806236ce5e4884a9912d3659199c082c9848fd271151d
MD5 c57e61d83bf4f0b12f8bc069e7cc2731
BLAKE2b-256 2f7d83f040c6d18a94ba3f14714c050b34cad15ed9c5a3fb39c6d7e87da88613

See more details on using hashes here.

File details

Details for the file ingrain-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: ingrain-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ingrain-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aa71a1682b1b899190bdfdca19bdce743df76fd8a69c5881915c2f59a17fac6e
MD5 3ab541a51e2c8d3eb0b2d4360d4a9889
BLAKE2b-256 b31691c199e69f84e8a219d6c6ef61b671cb755efd4dac0a83fed9607e1ab1c7

See more details on using hashes here.

Supported by

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