From 89f5093dfcb9acf53ef2507f51137e1e05202952 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Tue, 19 Nov 2024 21:05:59 -0800 Subject: [PATCH] Fix tgi doc --- distributions/dependencies.json | 254 +++++++++--------- llama_stack/scripts/distro_codegen.py | 5 +- llama_stack/templates/tgi/build.yaml | 2 +- .../templates/tgi/run-with-safety.yaml | 2 +- llama_stack/templates/tgi/run.yaml | 2 +- llama_stack/templates/tgi/tgi.py | 2 +- 6 files changed, 132 insertions(+), 135 deletions(-) diff --git a/distributions/dependencies.json b/distributions/dependencies.json index 0f85b70c6..92ebd1105 100644 --- a/distributions/dependencies.json +++ b/distributions/dependencies.json @@ -1,177 +1,171 @@ { "together": [ - "pypdf", - "sentencepiece", - "pandas", - "redis", - "nltk", - "psycopg2-binary", - "scikit-learn", - "chardet", - "matplotlib", - "pillow", - "tqdm", - "chromadb-client", - "transformers", + "aiosqlite", "blobfile", - "aiosqlite", - "together", + "chardet", + "chromadb-client", "faiss-cpu", - "scipy", - "numpy", - "torch --index-url https://download.pytorch.org/whl/cpu", - "sentence-transformers --no-deps", - "aiosqlite", "fastapi", "fire", "httpx", - "uvicorn" + "matplotlib", + "nltk", + "numpy", + "pandas", + "pillow", + "psycopg2-binary", + "pypdf", + "redis", + "scikit-learn", + "scipy", + "sentencepiece", + "together", + "tqdm", + "transformers", + "uvicorn", + "sentence-transformers --no-deps", + "torch --index-url https://download.pytorch.org/whl/cpu" ], "remote-vllm": [ - "pypdf", - "sentencepiece", - "pandas", - "redis", - "nltk", - "psycopg2-binary", - "scikit-learn", - "chardet", - "matplotlib", - "pillow", - "tqdm", - "chromadb-client", - "transformers", - "openai", + "aiosqlite", "blobfile", - "aiosqlite", + "chardet", + "chromadb-client", "faiss-cpu", - "scipy", - "numpy", - "torch --index-url https://download.pytorch.org/whl/cpu", - "sentence-transformers --no-deps", - "aiosqlite", "fastapi", "fire", "httpx", - "uvicorn" + "matplotlib", + "nltk", + "numpy", + "openai", + "pandas", + "pillow", + "psycopg2-binary", + "pypdf", + "redis", + "scikit-learn", + "scipy", + "sentencepiece", + "tqdm", + "transformers", + "uvicorn", + "sentence-transformers --no-deps", + "torch --index-url https://download.pytorch.org/whl/cpu" ], "fireworks": [ - "pypdf", - "sentencepiece", - "pandas", - "redis", - "nltk", - "psycopg2-binary", - "scikit-learn", - "chardet", - "fireworks-ai", - "matplotlib", - "pillow", - "tqdm", - "chromadb-client", - "transformers", + "aiosqlite", "blobfile", - "aiosqlite", + "chardet", + "chromadb-client", "faiss-cpu", - "scipy", - "numpy", - "torch --index-url https://download.pytorch.org/whl/cpu", - "sentence-transformers --no-deps", - "aiosqlite", "fastapi", "fire", + "fireworks-ai", "httpx", - "uvicorn" + "matplotlib", + "nltk", + "numpy", + "pandas", + "pillow", + "psycopg2-binary", + "pypdf", + "redis", + "scikit-learn", + "scipy", + "sentencepiece", + "tqdm", + "transformers", + "uvicorn", + "sentence-transformers --no-deps", + "torch --index-url https://download.pytorch.org/whl/cpu" ], "tgi": [ - "pypdf", - "sentencepiece", - "pandas", - "redis", - "nltk", - "psycopg2-binary", - "scikit-learn", - "chardet", - "matplotlib", - "pillow", - "tqdm", - "huggingface_hub", - "chromadb-client", "aiohttp", - "transformers", + "aiosqlite", "blobfile", - "aiosqlite", + "chardet", + "chromadb-client", "faiss-cpu", - "scipy", - "numpy", - "torch --index-url https://download.pytorch.org/whl/cpu", - "sentence-transformers --no-deps", - "aiosqlite", "fastapi", "fire", "httpx", - "uvicorn" + "huggingface_hub", + "matplotlib", + "nltk", + "numpy", + "pandas", + "pillow", + "psycopg2-binary", + "pypdf", + "redis", + "scikit-learn", + "scipy", + "sentencepiece", + "tqdm", + "transformers", + "uvicorn", + "sentence-transformers --no-deps", + "torch --index-url https://download.pytorch.org/whl/cpu" ], "meta-reference-gpu": [ + "accelerate", + "aiosqlite", + "blobfile", + "chardet", + "chromadb-client", + "fairscale", + "faiss-cpu", + "fastapi", + "fire", + "httpx", + "lm-format-enforcer", + "matplotlib", + "nltk", + "numpy", + "pandas", + "pillow", + "psycopg2-binary", "pypdf", + "redis", + "scikit-learn", + "scipy", "sentencepiece", "torch", - "pandas", - "redis", - "nltk", - "psycopg2-binary", - "scikit-learn", - "chardet", - "accelerate", - "matplotlib", - "pillow", - "fairscale", - "tqdm", - "lm-format-enforcer", - "chromadb-client", - "transformers", - "blobfile", - "aiosqlite", "torchvision", - "faiss-cpu", + "tqdm", + "transformers", + "uvicorn", "zmq", - "scipy", - "numpy", - "torch --index-url https://download.pytorch.org/whl/cpu", "sentence-transformers --no-deps", - "aiosqlite", - "fastapi", - "fire", - "httpx", - "uvicorn" + "torch --index-url https://download.pytorch.org/whl/cpu" ], "ollama": [ - "ollama", - "pypdf", - "sentencepiece", - "pandas", - "redis", - "nltk", - "psycopg2-binary", - "scikit-learn", - "chardet", - "matplotlib", - "pillow", - "tqdm", - "chromadb-client", "aiohttp", - "transformers", + "aiosqlite", "blobfile", - "aiosqlite", + "chardet", + "chromadb-client", "faiss-cpu", - "scipy", - "numpy", - "torch --index-url https://download.pytorch.org/whl/cpu", - "sentence-transformers --no-deps", - "aiosqlite", "fastapi", "fire", "httpx", - "uvicorn" + "matplotlib", + "nltk", + "numpy", + "ollama", + "pandas", + "pillow", + "psycopg2-binary", + "pypdf", + "redis", + "scikit-learn", + "scipy", + "sentencepiece", + "tqdm", + "transformers", + "uvicorn", + "sentence-transformers --no-deps", + "torch --index-url https://download.pytorch.org/whl/cpu" ] } diff --git a/llama_stack/scripts/distro_codegen.py b/llama_stack/scripts/distro_codegen.py index 8bcf97374..b82319bd5 100644 --- a/llama_stack/scripts/distro_codegen.py +++ b/llama_stack/scripts/distro_codegen.py @@ -82,7 +82,10 @@ def collect_template_dependencies(template_dir: Path) -> tuple[str, list[str]]: template = template_func() normal_deps, special_deps = get_provider_dependencies(template.providers) # Combine all dependencies in order: normal deps, special deps, server deps - all_deps = normal_deps + special_deps + SERVER_DEPENDENCIES + all_deps = sorted(list(set(normal_deps + SERVER_DEPENDENCIES))) + sorted( + list(set(special_deps)) + ) + return template.name, all_deps except Exception: return None, [] diff --git a/llama_stack/templates/tgi/build.yaml b/llama_stack/templates/tgi/build.yaml index 5f44c2d86..0f7602e2f 100644 --- a/llama_stack/templates/tgi/build.yaml +++ b/llama_stack/templates/tgi/build.yaml @@ -2,7 +2,7 @@ version: '2' name: tgi distribution_spec: description: Use (an external) TGI server for running LLM inference - docker_image: llamastack/distribution-tgi:test-0.0.52rc3 + docker_image: null providers: inference: - remote::tgi diff --git a/llama_stack/templates/tgi/run-with-safety.yaml b/llama_stack/templates/tgi/run-with-safety.yaml index b988c28e1..ebf082cd6 100644 --- a/llama_stack/templates/tgi/run-with-safety.yaml +++ b/llama_stack/templates/tgi/run-with-safety.yaml @@ -1,6 +1,6 @@ version: '2' image_name: tgi -docker_image: llamastack/distribution-tgi:test-0.0.52rc3 +docker_image: null conda_env: tgi apis: - agents diff --git a/llama_stack/templates/tgi/run.yaml b/llama_stack/templates/tgi/run.yaml index 485c02ad8..352afabb5 100644 --- a/llama_stack/templates/tgi/run.yaml +++ b/llama_stack/templates/tgi/run.yaml @@ -1,6 +1,6 @@ version: '2' image_name: tgi -docker_image: llamastack/distribution-tgi:test-0.0.52rc3 +docker_image: null conda_env: tgi apis: - agents diff --git a/llama_stack/templates/tgi/tgi.py b/llama_stack/templates/tgi/tgi.py index 79f2ad395..caa341df3 100644 --- a/llama_stack/templates/tgi/tgi.py +++ b/llama_stack/templates/tgi/tgi.py @@ -41,7 +41,7 @@ def get_distribution_template() -> DistributionTemplate: name="tgi", distro_type="self_hosted", description="Use (an external) TGI server for running LLM inference", - docker_image="llamastack/distribution-tgi:test-0.0.52rc3", + docker_image=None, template_path=Path(__file__).parent / "doc_template.md", providers=providers, default_models=[inference_model, safety_model],