Pular para o conteúdo principal

Assistente de IA Local : Implementar Ollama e AnytingLLM no Jetson

Introdução

O Assistente de IA Local é uma aplicação de inteligência artificial que é executada em hardware e software locais, oferecendo recursos de interação inteligente e processamento de dados. Ele funciona de forma independente de serviços em nuvem, protegendo a privacidade do usuário enquanto fornece tempos de resposta rápidos e altos níveis de personalização.

Neste wiki, demonstraremos como configurar uma base de conhecimento local em dispositivos Jetson com ollama e AnythingLLM. Ao aproveitar os poderosos recursos de grandes modelos de linguagem, buscamos aumentar nossa eficiência de trabalho.

Pré-requisitos

  • Dispositivo Jetson com mais de 16 GB de memória.
  • O dispositivo de hardware precisa estar pré-gravado com o sistema operacional jetpack 5.1.1.
nota

Neste wiki, concluiremos as seguintes tarefas usando o Kit de Desenvolvimento NVIDIA® Jetson AGX Orin™ 64GB, mas você também pode tentar usar outros dispositivos Jetson.

Primeiros Passos

Conexão de Hardware

  • Conecte o dispositivo Jetson à rede, mouse, teclado e monitor.
nota

Claro, você também pode acessar remotamente o dispositivo Jetson via SSH pela rede local.

Instalar e Executar o Ollama

Aqui, recomendamos fortemente usar o jetson-examples para implantar rapidamente o Ollama no seu dispositivo Jetson.

Passo 1. Abra um terminal no dispositivo Jetson e execute o seguinte comando para instalar jetson-examples:

sudo apt install python3-pip
pip3 install jetson-examples

Passo 2. Para implantar o ollama no dispositivo Jetson com um único comando, podemos executar:

reComputer run ollama

Passo 3. Baixe o grande modelo Llama3 usando o Ollama:

ollama run llama3
info

Por favor, mantenha este terminal ativo.

Instalar e Executar o AnythingLLM

Podemos instalar o AnythingLLM de forma conveniente usando uma configuração local com Docker.

Passo 1. Execute o AnythingLLM no Jetson.

Reabra o terminal e insira o seguinte comando:

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

Passo 2. Configure sua própria base de conhecimento local.

Para acessar a aplicação completa, visite http://<jetson-ip>:3001 no seu navegador.

nota

Você pode inserir o comando ifconfig no terminal do Jetson para encontrar o endereço IP dele.

Siga as instruções na tela para concluir a configuração do AnythingLLM.

perigo

Observe que, na página de configuração de LLM Perference, devemos selecionar o grande modelo de linguagem Llama 3.1 do Ollama.

Por fim, importe os documentos necessários. O grande modelo de linguagem então responderá às perguntas com base nos documentos importados.

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

Neste ponto, você configurou com sucesso sua própria base de conhecimento local.

nota

Para tutoriais de configuração mais detalhados, consulte este link.

Vamos Executá-lo

Insira perguntas na caixa de diálogo, e o grande modelo de linguagem fornecerá respostas com base na base de conhecimento.

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.

Demonstração do Efeito

Aqui, usamos o assistente pessoal local configurado para consultar as informações de que precisamos.

Referências

Suporte Técnico & Discussão de Produto

Obrigado por escolher nossos produtos! Estamos aqui para fornecer diferentes tipos de suporte para garantir que sua experiência com nossos produtos seja a mais tranquila possível. Oferecemos vários canais de comunicação para atender a diferentes preferências e necessidades.

Loading Comments...