Repository: crewAIInc/crewAI (python)

Issue:
[Feature]Huggingface is not mentioned in the provider list but in documentation page also mentioned it as a provider
### Description

In the documentation page you have clearly mentioned about the llm [LLMs
](https://docs.crewai.com/concepts/llms#hugging-face) support for crew projects.But when we try to create a crew in the providers list i couldnt see HUggingface anywhere.

![Image](https://github.com/user-attachments/assets/ad5bee3c-c48d-4be9-a415-356e7739f0f8)

![Image](https://github.com/user-attachments/assets/db018e1a-9cc0-4e6f-ab38-40f60dee5f81)
![Image](https://github.com/user-attachments/assets/c416a914-c4e3-4c8d-a635-7c2c8f687bcb)

### Steps to Reproduce

In console,
1.crewai create crew x_crew
2.You can see top 12  providers list,you cant see huggingface there,so 12th option Others is selected
3.Another window will pop up,In that also i couldnt see any such options 


### Expected behavior

It will be much helpful if huggingface is also there as a provider.

### Screenshots/Code snippets

Sure

![Image](https://github.com/user-attachments/assets/a656bfba-41fa-47a9-a3ce-5b617ad3f210)
![Image](https://github.com/user-attachments/assets/881fd193-92fa-4e7e-bf0f-c0a797be6e18)

### Operating System

Ubuntu 22.04

### Python Version

3.10

### crewAI Version

0.108.0

### crewAI Tools Version

0.40.1

### Virtual Environment

Conda

### Evidence

Already shared

![Image](https://github.com/user-attachments/assets/acaa01c3-75dd-4eb6-aaf3-15edc7ec08ff)
![Image](https://github.com/user-attachments/assets/d419862e-38fb-4848-938c-4b1e739b9aa3)
![Image](https://github.com/user-attachments/assets/ae06b5a4-ce04-423a-9d2f-3b551903c7c3)

### Possible Solution

Include Huggingface also in the providers list if possible,Atleast llama ,phi,like models can be utilised in diverse projects.

### Additional context

None

Pull request description:
Fix #2551: Add Huggingface to provider list in CLI
This PR fixes issue #2551 by adding Huggingface to the provider list in the CLI.

### Changes:
- Added Huggingface to the `PROVIDERS` list
- Added Huggingface environment variables configuration
- Added Huggingface models to the `MODELS` dictionary
- Added tests to verify the changes

Link to Devin run: https://app.devin.ai/sessions/47cc5ca0b5aa4726a75c7e9271d24831
Requested by: Joe Moura (joao@crewai.com)

Patch:
diff --git a/docs/concepts/llms.mdx b/docs/concepts/llms.mdx
index 2aada5fa..f2f02774 100644
--- a/docs/concepts/llms.mdx
+++ b/docs/concepts/llms.mdx
@@ -535,14 +535,13 @@ In this section, you'll find detailed examples that help you select, configure,
   <Accordion title="Hugging Face">
     Set the following environment variables in your `.env` file:
     ```toml Code
-    HUGGINGFACE_API_KEY=<your-api-key>
+    HF_TOKEN=<your-api-key>
     ```
 
     Example usage in your CrewAI project:
     ```python Code
     llm = LLM(
-        model="huggingface/meta-llama/Meta-Llama-3.1-8B-Instruct",
-        base_url="your_api_endpoint"
+        model="huggingface/meta-llama/Meta-Llama-3.1-8B-Instruct"
     )
     ```
   </Accordion>
diff --git a/src/crewai/cli/constants.py b/src/crewai/cli/constants.py
index fec0b638..2e7ed372 100644
--- a/src/crewai/cli/constants.py
+++ b/src/crewai/cli/constants.py
@@ -91,6 +91,12 @@ ENV_VARS = {
             "key_name": "CEREBRAS_API_KEY",
         },
     ],
+    "huggingface": [
+        {
+            "prompt": "Enter your Huggingface API key (HF_TOKEN) (press Enter to skip)",
+            "key_name": "HF_TOKEN",
+        },
+    ],
     "sambanova": [
         {
             "prompt": "Enter your SambaNovaCloud API key (press Enter to skip)",
@@ -106,6 +112,7 @@ PROVIDERS = [
     "gemini",
     "nvidia_nim",
     "groq",
+    "huggingface",
     "ollama",
     "watson",
     "bedrock",
@@ -270,6 +277,12 @@ MODELS = {
         "bedrock/mistral.mistral-7b-instruct-v0:2",
         "bedrock/mistral.mixtral-8x7b-instruct-v0:1",
     ],
+    "huggingface": [
+        "huggingface/meta-llama/Meta-Llama-3.1-8B-Instruct",
+        "huggingface/mistralai/Mixtral-8x7B-Instruct-v0.1",
+        "huggingface/tiiuae/falcon-180B-chat",
+        "huggingface/google/gemma-7b-it",
+    ],
     "sambanova": [
         "sambanova/Meta-Llama-3.3-70B-Instruct",
         "sambanova/QwQ-32B-Preview",


Test patch:
diff --git a/tests/cli/test_constants.py b/tests/cli/test_constants.py
new file mode 100644
index 00000000..61d8e069
--- /dev/null
+++ b/tests/cli/test_constants.py
@@ -0,0 +1,23 @@
+import pytest
+
+from crewai.cli.constants import ENV_VARS, MODELS, PROVIDERS
+
+
+def test_huggingface_in_providers():
+    """Test that Huggingface is in the PROVIDERS list."""
+    assert "huggingface" in PROVIDERS
+
+
+def test_huggingface_env_vars():
+    """Test that Huggingface environment variables are properly configured."""
+    assert "huggingface" in ENV_VARS
+    assert any(
+        detail.get("key_name") == "HF_TOKEN"
+        for detail in ENV_VARS["huggingface"]
+    )
+
+
+def test_huggingface_models():
+    """Test that Huggingface models are properly configured."""
+    assert "huggingface" in MODELS
+    assert len(MODELS["huggingface"]) > 0