Skip to content

Conversation

dltn
Copy link
Contributor

@dltn dltn commented Nov 8, 2024

What does this PR do?

Every provider has its own Python dependencies:

https://github.com/meta-llama/llama-stack/blob/6192bf43a4ce6ae3ac03f7fd0eea22c261f10e4d/llama_stack/providers/registry/inference.py#L12-L21

When you llama stack build, we dynamically determine what packages are needed and install them in the distribution's environment. However, we've recently added two workflows (pytest, direct client) where you're bypassing this and might not have the packages installed. Since the dependency list depends on your Llama Stack config, it's not as simple as requirements.txt.

This PR:

  1. Factors out the logic that determines the dependency list
  2. Adds a print_pip_install_help function
  3. Adds this helper function to the test impl resolvers

I'll also use this helper in the direct client in a subsequent PR.

Feature/Issue validation/testing/test plan

pytest -s llama_stack/providers/tests/agents/test_agents.py

Before:

Please install needed dependencies using the following commands:

        pip install pillow redis chardet scikit-learn sentencepiece faiss-cpu pypdf blobfile transformers nltk scipy together numpy matplotlib psycopg2-binary aiosqlite tqdm pandas
        pip install torch --index-url https://download.pytorch.org/whl/cpu
        pip install sentence-transformers --no-deps

ModuleNotFoundError: No module named 'together'

(Run the commands it gives me)

After:

tests pass

llama stack build behavior is unchanged

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 8, 2024
Copy link
Contributor

@ashwinb ashwinb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@dltn dltn merged commit 5625aef into main Nov 8, 2024
2 checks passed
@dltn dltn deleted the add-inline branch November 8, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants