diff --git a/docs/docs/connecting-your-llm/connecting-llama-via-huggingface.md b/docs/docs/connecting-your-llm/connecting-llama-via-huggingface.md new file mode 100644 index 0000000..1c4a8a4 --- /dev/null +++ b/docs/docs/connecting-your-llm/connecting-llama-via-huggingface.md @@ -0,0 +1,63 @@ +--- +sidebar_position: 1 +--- + +# Connecting to Llama via Hugging Face + +To connect CP4M to Llama via Hugging Face, you will need: +1. A Hugging Face account +2. Access to the Llama model from Meta + +## Sign up for a Hugging Face account +Hugging Face is a platform that helps you build, deploy, and train machine learning models. You can sign up for an account [here](https://huggingface.co/join). + +![Hugging Face Home Page](./img/hugging-face-home-page.png) + +## Accessing the Llama model on Hugging Face +Hugging Face has a large repository of machine learning models for a variety of use cases accessible [here](https://huggingface.co/models). + +You can search for the LLama model from Meta of your choice. For the purposes of this tutorial, we will be using the [LLama-2-7b-chat-hf model](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf). + +In order to use the Llama model, you will need to accept the Llama 2 Community License Agreement on the [model page](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf). + +![Gated model agremeent](./img/hugging-face-gated-model-agreement.png) + +Once your account is approved, the model page will inform you that you have been granted access. + +![Gated model access](./img/hugging-face-gated-model-access.png) + +## Deploying model using Inference API +The fastest way to deploy Llama is through Hugging Face's serverless Inference API. + +1. Go to the [Llama model page](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf). +2. On the top right, click on the **Deploy** dropdown button. + +![Model Deploy](./img/hugging-face-model-deploy.png) + + +3. In the dropdown, click the **Inference API (serverless)** option. *Note: Using Inference API requires a [Hugging Face Pro subscription](https://huggingface.co/pricing)*. + +![Inference API First Time](./img/hugging-face-inference-api-first-time.png) + +4. On the new modal, click the **Token** dropdown then click **+ New access token**. + +![Inference API New Token](./img/hugging-face-inference-api-new-token.png) + +5. On the access tokens page, click the **New Token** button. + +![Access Token Page](./img/hugging-face-access-token.png) + +6. Create a new access token with the **Write** permission. + +![Create Access Token Modal](./img/hugging-face-create-access-token.png) + +7. Go back to the Model Deploy > Inference API page [here](https://huggingface.co/meta-llama/Llama-2-7b-chat-hf?inference_api=true). Your newly created access token should now be populated in the **Token** section. + +## Updating your CP4M config from Inference API +7. Copy and paste the *API_URL* on the Deploy Inference API modal to your CP4M config file in the "\[\[plugins]] endpoint" entry. If you are using the Llama-2-7b-chat-hf model, it should be "https://api-inference.huggingface.co/models/meta-llama/Llama-2-7b-chat-hf". + +![Inference API code](./img/hugging-face-inference-api-code.png) + +8. Click **Show API token**. Copy and paste this API token to your CP4M config file in the "\[\[plugins]] api_key" entry. + +Congratulations! You have now successfully set up CP4M with Llama via Hugging Face. diff --git a/docs/docs/connecting-your-llm/connecting-openai.md b/docs/docs/connecting-your-llm/connecting-openai.md new file mode 100644 index 0000000..119bce8 --- /dev/null +++ b/docs/docs/connecting-your-llm/connecting-openai.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 2 +--- + +# Connecting to OpenAI + +Coming soon... diff --git a/docs/docs/connecting-your-llm/img/docsVersionDropdown.png b/docs/docs/connecting-your-llm/img/docsVersionDropdown.png deleted file mode 100644 index 97e4164..0000000 Binary files a/docs/docs/connecting-your-llm/img/docsVersionDropdown.png and /dev/null differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-access-token.png b/docs/docs/connecting-your-llm/img/hugging-face-access-token.png new file mode 100644 index 0000000..38caf63 Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-access-token.png differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-create-access-token.png b/docs/docs/connecting-your-llm/img/hugging-face-create-access-token.png new file mode 100644 index 0000000..0d585d7 Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-create-access-token.png differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-gated-model-access.png b/docs/docs/connecting-your-llm/img/hugging-face-gated-model-access.png new file mode 100644 index 0000000..020d022 Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-gated-model-access.png differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-gated-model-agreement.png b/docs/docs/connecting-your-llm/img/hugging-face-gated-model-agreement.png new file mode 100644 index 0000000..5cef8e4 Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-gated-model-agreement.png differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-home-page.png b/docs/docs/connecting-your-llm/img/hugging-face-home-page.png new file mode 100644 index 0000000..244e680 Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-home-page.png differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-inference-api-code.png b/docs/docs/connecting-your-llm/img/hugging-face-inference-api-code.png new file mode 100644 index 0000000..482c371 Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-inference-api-code.png differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-inference-api-first-time.png b/docs/docs/connecting-your-llm/img/hugging-face-inference-api-first-time.png new file mode 100644 index 0000000..9b1e716 Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-inference-api-first-time.png differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-inference-api-new-token.png b/docs/docs/connecting-your-llm/img/hugging-face-inference-api-new-token.png new file mode 100644 index 0000000..1ea6261 Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-inference-api-new-token.png differ diff --git a/docs/docs/connecting-your-llm/img/hugging-face-model-deploy.png b/docs/docs/connecting-your-llm/img/hugging-face-model-deploy.png new file mode 100644 index 0000000..a8898ec Binary files /dev/null and b/docs/docs/connecting-your-llm/img/hugging-face-model-deploy.png differ diff --git a/docs/docs/connecting-your-llm/img/localeDropdown.png b/docs/docs/connecting-your-llm/img/localeDropdown.png deleted file mode 100644 index e257edc..0000000 Binary files a/docs/docs/connecting-your-llm/img/localeDropdown.png and /dev/null differ diff --git a/docs/docs/connecting-your-llm/llama-via-huggingface.md b/docs/docs/connecting-your-llm/llama-via-huggingface.md deleted file mode 100644 index 812b612..0000000 --- a/docs/docs/connecting-your-llm/llama-via-huggingface.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -sidebar_position: 1 ---- - -# Connecting to Llama via Hugging Face - -Coming soon... diff --git a/docs/docs/messaging-integrations/connecting-to-instagram-direct.md b/docs/docs/messaging-integrations/connecting-to-instagram-direct.md new file mode 100644 index 0000000..877f61d --- /dev/null +++ b/docs/docs/messaging-integrations/connecting-to-instagram-direct.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 2 +--- + +# Connecting to Instagram Direct + +Coming soon... diff --git a/docs/docs/messaging-integrations/connecting-to-messenger.md b/docs/docs/messaging-integrations/connecting-to-messenger.md index 578b325..018d4f0 100644 --- a/docs/docs/messaging-integrations/connecting-to-messenger.md +++ b/docs/docs/messaging-integrations/connecting-to-messenger.md @@ -6,8 +6,8 @@ sidebar_position: 1 To connect CP4M to Facebook Messenger, you will need: 1. A Facebook account registered as a Meta developer -1. A Meta app to integrate with Meta APIs -2. A Facebook Page for users to interact with over Messenger +2. A Meta app to integrate with Meta APIs +3. A Facebook Page for users to interact with over Messenger ## Getting Meta developer access To register as a Meta developer, you can follow the steps [here](https://developers.facebook.com/docs/development/register). diff --git a/docs/docs/messaging-integrations/connecting-to-whatsapp.md b/docs/docs/messaging-integrations/connecting-to-whatsapp.md new file mode 100644 index 0000000..8f04555 --- /dev/null +++ b/docs/docs/messaging-integrations/connecting-to-whatsapp.md @@ -0,0 +1,7 @@ +--- +sidebar_position: 3 +--- + +# Connecting to Whatsapp + +Coming soon... diff --git a/docs/src/pages/index.js b/docs/src/pages/index.js index 4856738..4f2d34f 100644 --- a/docs/src/pages/index.js +++ b/docs/src/pages/index.js @@ -35,7 +35,7 @@ const features = [ ), }, { - title: 'Free and Open Source', + title: 'Welcoming Collaborators', imageUrl: 'CP4M/img/undraw_docusaurus_react.svg', description: ( <>