/ setup.py
setup.py
  1  # pylint: disable = C0111
  2  from setuptools import find_packages, setup
  3  
  4  with open("README.md", "r", encoding="utf-8") as f:
  5      # Remove GitHub dark mode images
  6      DESCRIPTION = "".join([line for line in f if "gh-dark-mode-only" not in line])
  7  
  8  # Required dependencies
  9  install = ["faiss-cpu>=1.7.1.post2", "msgpack>=1.0.7", "torch>=2.4", "transformers>=4.56.2"]
 10  
 11  # Required dependencies that are also base transformers dependencies
 12  install += ["huggingface-hub>=0.34.0", "numpy>=1.18.4", "pyyaml>=5.3", "regex>=2022.8.17", "safetensors>=0.4.5"]
 13  
 14  # Optional dependencies
 15  extras = {}
 16  
 17  # Development dependencies - not included in "all" install
 18  extras["dev"] = [
 19      "black",
 20      "coverage",
 21      "coveralls",
 22      "httpx",
 23      "mkdocs-material",
 24      "mkdocs-redirects",
 25      "mkdocstrings[python]",
 26      "pre-commit",
 27      "pylint",
 28  ]
 29  
 30  extras["agent"] = ["jinja2>=3.1.6", "mcpadapt>=0.1.0", "smolagents>=1.23"]
 31  
 32  extras["ann"] = [
 33      "annoy>=1.16.3",
 34      "bitsandbytes>=0.42.0",
 35      "ggml-py>=0.9.4",
 36      "hnswlib>=0.5.0",
 37      "pgvector>=0.4.1",
 38      "scikit-learn>=0.23.1",
 39      "scipy>=1.4.1",
 40      "sqlalchemy>=2.0.20",
 41      "sqlite-vec>=0.1.1",
 42  ]
 43  
 44  extras["api"] = [
 45      "aiohttp>=3.8.1",
 46      "fastapi>=0.94.0",
 47      "fastapi-mcp>=0.4.0",
 48      "httpx>=0.28.1",
 49      "pillow>=7.1.2",
 50      "python-multipart>=0.0.7",
 51      "uvicorn>=0.12.1",
 52  ]
 53  
 54  extras["cloud"] = ["apache-libcloud>=3.3.1", "fasteners>=0.14.1"]
 55  
 56  extras["console"] = ["rich>=12.0.1"]
 57  
 58  extras["database"] = ["duckdb>=0.8.0", "pillow>=7.1.2", "sqlalchemy>=2.0.20"]
 59  
 60  extras["graph"] = ["grand-cypher>=0.6.0", "grand-graph>=0.6.0", "networkx>=2.7.1", "sqlalchemy>=2.0.20"]
 61  
 62  extras["model"] = ["onnx>=1.11.0", "onnxruntime>=1.11.0"]
 63  
 64  extras["pipeline-audio"] = [
 65      "onnx>=1.11.0",
 66      "onnxruntime>=1.11.0",
 67      "scipy>=1.4.1",
 68      "sounddevice>=0.5.0",
 69      "soundfile>=0.10.3.post1",
 70      "ttstokenizer>=1.1.0",
 71      "webrtcvad-wheels>=2.0.14",
 72  ]
 73  
 74  extras["pipeline-data"] = ["beautifulsoup4>=4.9.3", "chonkie>=1.0.2", "docling>=2.8.2", "nltk>=3.5", "pandas>=1.1.0", "tika>=1.24"]
 75  
 76  extras["pipeline-image"] = ["imagehash>=4.2.1", "pillow>=7.1.2", "timm>=0.4.12"]
 77  
 78  extras["pipeline-llm"] = ["httpx>=0.28.1", "litellm>=1.37.16", "llama-cpp-python>=0.2.75"]
 79  
 80  extras["pipeline-text"] = ["gliner>=0.2.23", "sentencepiece>=0.1.91", "staticvectors>=0.2.0"]
 81  
 82  extras["pipeline-train"] = [
 83      "accelerate>=0.26.0",
 84      "bitsandbytes>=0.42.0",
 85      "onnx>=1.11.0",
 86      "onnxmltools>=1.9.1",
 87      "onnxruntime>=1.11.0",
 88      "peft>=0.8.1",
 89      "skl2onnx>=1.9.1",
 90  ]
 91  
 92  extras["pipeline"] = (
 93      extras["pipeline-audio"]
 94      + extras["pipeline-data"]
 95      + extras["pipeline-image"]
 96      + extras["pipeline-llm"]
 97      + extras["pipeline-text"]
 98      + extras["pipeline-train"]
 99  )
100  
101  extras["scoring"] = ["sqlalchemy>=2.0.20"]
102  
103  extras["vectors"] = [
104      "litellm>=1.37.16",
105      "llama-cpp-python>=0.2.75",
106      "model2vec>=0.3.0",
107      "scikit-learn>=0.23.1",
108      "scipy>=1.4.1",
109      "sentence-transformers>=5.0.0",
110      "skops>=0.9.0",
111      "staticvectors>=0.2.0",
112  ]
113  
114  extras["workflow"] = [
115      "apache-libcloud>=3.3.1",
116      "croniter>=1.2.0",
117      "openpyxl>=3.0.9",
118      "pandas>=1.1.0",
119      "pillow>=7.1.2",
120      "requests>=2.26.0",
121      "xmltodict>=0.12.0",
122  ]
123  
124  # Backwards-compatible combination of ann and vectors extra
125  extras["similarity"] = extras["ann"] + extras["vectors"]
126  
127  extras["all"] = (
128      extras["agent"]
129      + extras["api"]
130      + extras["cloud"]
131      + extras["console"]
132      + extras["database"]
133      + extras["graph"]
134      + extras["model"]
135      + extras["pipeline"]
136      + extras["scoring"]
137      + extras["similarity"]
138      + extras["workflow"]
139  )
140  
141  setup(
142      name="txtai",
143      version="9.8.0",
144      author="NeuML",
145      description="All-in-one open-source AI framework for semantic search, LLM orchestration and language model workflows",
146      long_description=DESCRIPTION,
147      long_description_content_type="text/markdown",
148      url="https://github.com/neuml/txtai",
149      project_urls={
150          "Documentation": "https://github.com/neuml/txtai",
151          "Issue Tracker": "https://github.com/neuml/txtai/issues",
152          "Source Code": "https://github.com/neuml/txtai",
153      },
154      license="Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0",
155      packages=find_packages(where="src/python"),
156      package_dir={"": "src/python"},
157      keywords="search embedding machine-learning nlp",
158      python_requires=">=3.10",
159      install_requires=install,
160      extras_require=extras,
161      classifiers=[
162          "License :: OSI Approved :: Apache Software License",
163          "Operating System :: OS Independent",
164          "Programming Language :: Python :: 3",
165          "Topic :: Scientific/Engineering :: Artificial Intelligence",
166          "Topic :: Software Development",
167          "Topic :: Text Processing :: Indexing",
168          "Topic :: Utilities",
169      ],
170  )