Asistente de IA local: implementa Ollama y AnytingLLM en la Jetson
Introducción
Local AI Assistant es una aplicación de inteligencia artificial que se ejecuta en hardware y software local y ofrece interacción inteligente y capacidades de procesamiento de datos. Opera independientemente de los servicios en la nube, protegiendo la privacidad del usuario y al mismo tiempo brinda tiempos de respuesta rápidos y altos niveles de personalización.

En esta wiki, demostraremos cómo configurar una base de conocimientos local en dispositivos Jetson con ollama y AnythingLLM. Al aprovechar las poderosas capacidades de los LLM's, nuestro objetivo es mejorar la eficiencia de nuestro trabajo.
Prerequisitos
- Dispositivo Jetson con más de 16GB de memoria.
- El dispositivo debe ser previamente flasheado con el sistema operativo jetpack 5.1.1.
:::nota En esta wiki, trabajaremos utilizando el NVIDIA® Jetson AGX Orin™ 64GB Developer Kit, pero también puedes intentar usar otros dispositivos Jetson. :::

Primeros pasos
Conexiones de Hardware
- Conecta el dispositivo Jetson a la red, también cablea: el mouse, el teclado y el monitor.
:::nota Por supuesto, también puedes acceder de forma remota al dispositivo Jetson a través de SSH mediante la red local. :::
Instalar y Correr Ollama
Aquí, recomendamos encarecidamente utilizar jetson-examples para implementar rápidamente Ollama en tu dispositivo Jetson.
Paso 1. Abre una terminal en el dispositivo Jetson y ejecuta el siguiente comando para instalar jetson-examples
:
sudo apt install python3-pip
pip3 install jetson-examples
Paso 2. Para implementar ollama en el dispositivo Jetson con un solo comando, podemos ejecutar el siguiente comando:
reComputer run ollama
Paso 3. Descarga el LLM de Llama3 usando Ollama:
ollama run llama3
Por favor, mantén esta terminal activa
Instala y corre AnythingLLM
Podemos instalar cómodamente AnythingLLM usando una configuración local de Docker.
Paso 1. Ejecuta AnythingLLM en la Jetson.
Vuelve a abrir la terminal e ingresa el siguiente 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
Paso 2. Configura tu propia base de conocimientos local.
Para acceder a la aplicación completa, visita http://<jetson-ip>:3001
en tu navegador.
:::nota
Puedes ingresar el comando ifconfig
en la terminal de la Jetson para encontrar tu dirección IP.
:::

Sigue las instrucciones en pantalla para completar la configuración de AnythingLLM.
:::Peligro
Ten en cuenta que en la página de configuración de LLM Perference
, debemos seleccionar el LLM Llama 3.1 de Ollama.
:::

Finalmente, importa los documentos necesarios. Luego, el LLM responderá preguntas basadas en los documentos importados.
import
--> click to upload or drag and drop
--> select document
--> move to Workspace
--> save and embed

En este punto, has configurado con éxito tu propia base de conocimientos local.
:::nota Para obtener tutoriales de configuración más detallados, consulta este enlace. :::
¡Ejecutemos el sistema!
Ingresa preguntas en el cuadro de diálogo y el LLM proporcionará respuestas basadas en la base de conocimientos.

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.
Demostración
Aquí, utilizamos el asistente personal local configurado para consultar la información que necesitamos.
Referencias
- https://ollama.com/library/llama3.1
- https://anythingllm.com/
- https://www.youtube.com/watch?v=4UFrVvy7VlA&t=4s
Soporte Tech y discusión del producto
¡Gracias por elegir nuestros productos! Estamos aquí para darte soporte y asegurar que tu experiencia con nuestros productos sea la mejor posible. Tenemos diversos canales de comunicación para adaptarnos distintas preferencias y necesidades.