Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/docs/api_reference/embeddings/nvidia_triton.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
::: llama_index.embeddings.nvidia_triton
options:
members:
- NvidiaTritonEmbedding
2 changes: 2 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ nav:
- ./api_reference/embeddings/netmind.md
- ./api_reference/embeddings/nomic.md
- ./api_reference/embeddings/nvidia.md
- ./api_reference/embeddings/nvidia_triton.md
- ./api_reference/embeddings/oci_data_science.md
- ./api_reference/embeddings/oci_genai.md
- ./api_reference/embeddings/octoai.md
Expand Down Expand Up @@ -2481,6 +2482,7 @@ plugins:
- ../llama-index-integrations/protocols/llama-index-protocols-ag-ui
- ../llama-index-integrations/vector_stores/llama-index-vector-stores-openGauss
- ../llama-index-integrations/tools/llama-index-tools-hive
- ../llama-index-integrations/embeddings/llama-index-embeddings-nvidia-triton
- ../llama-index-integrations/vector_stores/llama-index-vector-stores-db2
- ../llama-index-integrations/voice_agents/llama-index-voice-agents-openai
- ../llama-index-integrations/indices/llama-index-indices-managed-lancedb
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
llama_index/_static
.DS_Store
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
bin/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
etc/
include/
lib/
lib64/
parts/
sdist/
share/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
.ruff_cache

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints
notebooks/

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
pyvenv.cfg

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Jetbrains
.idea
modules/
*.swp

# VsCode
.vscode

# pipenv
Pipfile
Pipfile.lock

# pyright
pyrightconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) Jerry Liu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
GIT_ROOT ?= $(shell git rev-parse --show-toplevel)

help: ## Show all Makefile targets.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[33m%-30s\033[0m %s\n", $$1, $$2}'

format: ## Run code autoformatters (black).
pre-commit install
git ls-files | xargs pre-commit run black --files

lint: ## Run linters: pre-commit (black, ruff, codespell) and mypy
pre-commit install && git ls-files | xargs pre-commit run --show-diff-on-failure --files

test: ## Run tests via pytest.
pytest tests

watch-docs: ## Build and watch documentation.
sphinx-autobuild docs/ docs/_build/html --open-browser --watch $(GIT_ROOT)/llama_index/
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# LlamaIndex Embeddings Integration: Nvidia Triton

This integration allows LlamaIndex to use embedding models hosted on a [Triton Inference Server](https://github.com/triton-inference-server/server).

## Usage:

```python
from llama_index.embeddings.nvidia_triton import NvidiaTritonEmbedding

embedding = NvidiaTritonEmbedding(
model_name="text_embeddings",
server_url="localhost:8000",
client_kwargs={"ssl": False},
)

print(embedding.get_text_embedding("hello world"))
```

Parameters:

- `model_name`: the name of the embedding model.
- `server_url`: the URL to the Triton Inference Server, normally on the HTTP port.
- `client_kwargs`: additional arguments to be passed to the `tritonclient.http.InferenceServerClient` instance, such us timeouts, ssl, etc.
- `input_tensor_name`: the name of the tensor the embedding model expects the input to be. Default: `INPUT_TEXT`.
- `output_tensor_name`: the name of the tensor the embedding model will serve the output embedding to. Default: `OUTPUT_EMBEDDINGS`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from llama_index.embeddings.nvidia_triton.base import NvidiaTritonEmbedding

__all__ = ["NvidiaTritonEmbedding"]
Loading