summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/model-hosting-container-standards/default.nix
blob: ebedd42138798ac1d3cb4808dc53dced4803226d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  poetry-core,

  # dependencies
  fastapi,
  httpx,
  jmespath,
  pydantic,
  starlette,
  supervisor,

  # tests
  pytest-asyncio,
  pytestCheckHook,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "model-hosting-container-standards";
  version = "0.1.13";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "aws";
    repo = "model-hosting-container-standards";
    tag = "v${finalAttrs.version}";
    hash = "sha256-t7+yZ4jKsU9tlcr22jiqL3fVI0z704xHCQbSDsbWMfk=";
  };

  sourceRoot = "${finalAttrs.src.name}/python";

  build-system = [
    poetry-core
  ];

  pythonRemoveDeps = [
    # Declared as a runtime dependency, but not used in practice
    "setuptools"
  ];
  dependencies = [
    fastapi
    httpx
    jmespath
    pydantic
    starlette
    supervisor
  ];

  pythonImportsCheck = [ "model_hosting_container_standards" ];

  nativeCheckInputs = [
    pytest-asyncio
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  disabledTests = [
    # AssertionError: Server should have created restart log
    "test_continuous_restart_behavior"
    "test_startup_retry_limit"
  ];

  meta = {
    description = "Standardized Python framework for seamless integration between ML frameworks (TensorRT-LLM, vLLM) and Amazon SageMaker hosting";
    homepage = "https://github.com/aws/model-hosting-container-standards/tree/main/python";
    changelog = "https://github.com/aws/model-hosting-container-standards/blob/${finalAttrs.src.tag}/CHANGELOG.md";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
})