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.2.tar.gz (11.6 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.2-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ingrain-0.2.2.tar.gz
  • Upload date:
  • Size: 11.6 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.2.tar.gz
Algorithm Hash digest
SHA256 b0119e8f9c369b2f7a5abe65782c3971ac4e0852204095060f324c744fad04f3
MD5 d2b61b772ed324476b98c86d88fe1ad9
BLAKE2b-256 e6e139844eeb95b4adc3117255e51d53f08013abc87f9dbc230708bbd0de58ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ingrain-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 9.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 10089a558e5d0a7236dac72dff755a3525ada3a4713958c7bd939bff1ab25940
MD5 413e97a9c082a7eaeec4d083492d7a3b
BLAKE2b-256 25be80166f4c15d00ed84a2a01da91045e61be3d627c95b93345a44ba242963a

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