ローカルAIアシスタント:JetsonにOllamaとAnythingLLMをデプロイする

イントロダクション

ローカルAIアシスタントとは、ローカル上のハードウェアとソフトウェアで実行される人工知能アプリケーションであり、人工知能とデータ処理能力を提供します。クラウドサービスから独立して動作し、素早い応答と高度なカスタマイズ性を提供しながら、ユーザーのプライバシーを保護することができます。

AnythingLLM

このwikiでは、OllamaAnythingLLMを使用して、Jetsonデバイス上にローカルナレッジベースをセットアップする方法を説明します。大規模言語モデルの強力な能力を活用することで、作業効率の向上を目指します。

前提条件

  • 16GB以上のメモリを搭載したJetsonデバイス
  • Jetpack 5.1.1をインストール済み

[!NOTE] このwikiではNVIDIA Jetson AGX Orin 64GB開発者キットを使用して、すべての工程を行っていますが、他の条件を満たすJetsonデバイスで試すことも可能です。

はじめに

ハードウェアの準備

  • Jetsonデバイスにネットワーク、マウス、キーボード、モニターを接続します。

[!NOTE] もちろん、Jetsonデバイスにローカルネットワーク上のSSH経由でリモートアクセスすることも可能です。

Ollamaをインストールして実行

JeetsonデバイスにOllamaをすばやくデプロイするために、ここではjetson-examplesを使用することを強くお勧めします。

ステップ1: Jetsonデバイスでターミナルを開きます。次のコマンドを実行して、jetson-examplesをインストールします。

sudo apt install python3-pip
pip3 install jetson-examples

ステップ2: 次のコマンドを実行し、JetsonデバイスにOllamaをデプロイします。

reComputer run ollama

ステップ3: Ollamaを使用して大規模モデルLlama3をダウンロードします。

ollama run llama3

[!NOTE] このターミナルはアクティブのままにしておいてください。

AnythingLLMをインストールして実行

local Docker setupを使用すると、AnythingLLMを簡単にインストールできます。

ステップ1: JetsonでAnythingLLMを実行

ターミナルを再度開き、次のコマンドを入力します。

docker pull mintplexlabs/anythingllm

export STORAGE_LOCATION=$HOME/anythingllm 
mkdir -p $STORAGE_LOCATION 
touch "$STORAGE_LOCATION/.env" 
docker run -d -p 3001:3001 --cap-add SYS_ADMIN \
    -v ${STORAGE_LOCATION}:/app/server/storage \
    -v ${STORAGE_LOCATION}/.env:/app/server/.env \
    -e STORAGE_DIR="/app/server/storage" \
    mintplexlabs/anythingllm

ステップ2: 自分自身のローカルナレッジベースを構成

ブラウザでhttp://<jetson-ip>:3001にアクセスします。

[!NOTE] Jetsonのターミナルでifconfigコマンドを入力することで、JetsonのIPアドレスが分かります。

AnythingLLM init

画面の指示に従ってAnythinsLLMの設定を完了します。

[!CAUTION] LLM Perferenceの設定ページで、OlaamのLlama 3.1大規模言語モデルを選択する必要があることに注意してください。

select-ollama

最後に必要なドキュメントをインポートします。大規模言語モデルはインポートしたドキュメントに基づき質問に回答します。

import –> click to upload or drag and drop –> select document –> move to Workspace –> save and embed

import doc

これでローカルナレッジベースが正常にセットアップされました。

[!NOTE] より詳細な設定のチュートリアルは、このリンクを参照してください。

実行

ダイアログボックスに質問を入力すると、大規模言語モデルはナレッジベースに基づいて回答を提供します。

test chat

story1.txt (クリックして展開)


Once upon a time in a quaint village nestled between rolling hills, there was a young girl named Eliza who loved to explore the woods behind her home. The forest was a magical place, filled with tall trees that whispered secrets, streams that sang soft melodies, and flowers that seemed to glow under the moonlight.

One sunny morning, Eliza set out on one of her adventures, her heart brimming with excitement. As she wandered deeper into the forest, she discovered a hidden path she had never seen before. The path was lined with shimmering stones that sparkled like stars. Curious and intrigued, Eliza followed it.

After a short walk, the path led her to a magnificent clearing where a majestic oak tree stood in the center. At the base of the tree was a small, ornate door. It was covered in intricate carvings of animals and vines. Eliza, with her heart pounding with both excitement and nervousness, gently pushed the door open.

Inside, she found herself in a cozy, enchanted room. There were shelves lined with books and strange artifacts, and a warm fire crackling in a stone hearth. In the middle of the room, a wise old owl perched on a branch of a large, leafy plant.

The owl looked at Eliza with kind, knowing eyes. “Welcome, young traveler,” it hooted softly. “I am Oliver, the guardian of this magical realm. Few people find their way here. You must have a special heart.”

Eliza’s eyes widened in awe. “What is this place?” she asked.

“This is the Realm of Wonders,” Oliver explained. “It is a place where dreams come to life and where those with pure intentions can find their heart’s true desire.”

Eliza gazed around the room, her curiosity piqued. “What can I do here?”

Oliver smiled. “You can make a wish. But remember, wishes made here come with great responsibility. They have the power to change not just your life but the lives of those around you.”

Eliza thought long and hard. She remembered how her village had been struggling with drought and how her friends and family were suffering. With a determined look, she made her wish.

“I wish for rain to fall upon my village and bring life back to the land.”

Oliver nodded approvingly. “A selfless wish. It will be granted.”

The next morning, as Eliza returned to her village, dark clouds gathered in the sky, and a gentle rain began to fall. The villagers looked up in amazement as the parched earth drank in the life-giving water. The fields began to turn green, and the village flourished once more.

Eliza’s heart swelled with joy as she realized the impact of her wish. The Realm of Wonders had given her the chance to make a difference, and she learned that true magic comes from caring for others.

From that day on, Eliza continued to explore the woods, knowing that the true wonders of life were found in kindness and selflessness.

And so, the village thrived, and Eliza’s adventures became the stuff of legends, reminding everyone that magic, indeed, begins with a kind heart.
    


デモ

ここでは設定されたローカルパーソナルアシスタントを使用して、必要な情報を照会しています。

リソース

テクニカルサポートと製品に関するフォーラム

ご購入いただいた製品をスムーズにお使いいただけるよう、Seeedでは様々なサポートを提供しています。ご希望に合わせてコンタクトの方法をお選びください。

出典 : Seeed Studio資料 Wiki - Local AI Assistant : Deploy Ollama and AnytingLLM on Jetson

https://wiki.seeedstudio.com/local_ai_ssistant/

*このガイドはSeeed Studioの許可を得て、スイッチサイエンスが翻訳しています。