Coder Social home page Coder Social logo

web-hybrid-ai's Introduction

Exploring Web Application Development with a Hybrid AI Architecture

Installing the Ollama Framework

  • Download the installation package from the Ollama official website: https://ollama.com/
  • After installation, Ollama will start automatically. Check if it's running successfully at http://localhost:11434/
  • If Ollama doesn't start automatically, run the command ollama serve to start the Ollama service manually.
  • Set the system environment variable OLLAMA_MODELS to the path where your models are saved, e.g., D:\ollama_models
  • Set the system environment variable OLLAMA_ORIGINS to * to allow cross-origin access to the Ollama service.
  • After setting the environment variables, restart the Ollama service.

Downloading and Installing the Llama Model

  • Download the model from Hugging Face: https://huggingface.co/ or its mirror: https://hf-mirror.com/
  • Filter models using the keyword llama gguf , download the .gguf file for the Llama model, and choose Meta-Llama-3.1-8B-Instruct-GGUF
  • In Files and versions , download Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf and save it to the models directory.
  • In the models directory, create or edit the llama.modelfile with the content: FROM ./Meta-Llama-3.1-8B-Instruct-Q5_K_M.gguf
  • In the models directory, execute the creation command: ollama create llama3:8b -f ./llama.modelfile
  • Run ollama list to check if the llama3:8b model is in the list, and then run ollama run llama3:8b to test the model.

Installing Chroma Vector Database

  • Download and install Python from https://www.python.org/ (ignore if already installed).
  • Install Chroma using the command: pip install chromadb
  • Open the .env file at the root directory and add ANONYMIZED_TELEMETRY=False to disable Chroma data collection.
  • Add CHROMA_SERVER_CORS_ALLOW_ORIGINS='["http://localhost:3000","http://127.0.0.1:5500"]' to the .env file.
  • Run the chroma run command in the root directory and check if it's running successfully at http://localhost:8000/
  • A chroma_data directory will be automatically created in the root directory. You can test the Chroma API at http://localhost:8000/docs

Installing Project Dependencies and Downloading the Gemma Model

  • In the root directory, run the yarn command to install dependencies, including the LangChain framework and Chroma client.
  • You can test the integration of Ollama, Chroma, and LangChain by running node rag.js
  • Start the 3000 and 5500 service ports by running npm run serve . Access the website at http://localhost:3000/ or http://127.0.0.1:5500/
  • Apply for a Gemini API key at Google AI Studio and save it to the key.js file in the root directory.
  • Download gemma-1.1-2b-it-gpu-int4.bin from Kaggle: https://www.kaggle.com/ and save it to the models directory.

Accessing Hybrid AI Application Examples

web-hybrid-ai's People

Contributors

kevinmoch avatar

Watchers

宇果 avatar LiHao avatar Kagol avatar  avatar ajaxzheng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.