Giter Site home page Giter Site logo

sciphi-example's Introduction

SciPhi AI example

This is an example based on SciPhi-AI/R2R-qna-rag-prebuilt.

How to execute it

Different modes:

  • Local with pgvector
  • Docker with pgvector (own infrastructure)
  • SciPhi

Required environment variables for all modes

  • OPENAI_API_KEY
  • ANTHROPIC_API_KEY: anthropic.com
  • CONFIDENTAI_API_KEY: For Confident AI's deepeval prompt evaluations/monitoring. An alternative for this is Parea AI.
$ export OPENAI_API_KEY=xxxxxx
$ export ANTHROPIC_API_KEY=yyyyyy
$ export CONFIDENT_API_KEY=zzzzzz

Local with pgvector

Uses src/app-external.py application.

pgvector is a vectorial database based on PostgreSQL.

  • CONFIG_PATH: JSON config file name.
  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • POSTGRES_HOST
  • POSTGRES_PORT
  • POSTGRES_DBNAME

Example:

# Using Python >=3.12
$ python3 -m venv env
$ source env/bin/activate
(env) $ pip install -r docker/requirements.txt
(env) $ export CONFIG_PATH="./docker/config-pgvector.json"
(env) $ export POSTGRES_USER=vectordb
(env) $ export POSTGRES_PASSWORD=vectordb
(env) $ export POSTGRES_HOST=localhost
(env) $ export POSTGRES_PORT=5432
(env) $ export POSTGRES_DBNAME=vectordb
(env) $ ./start.sh

Docker with pgvector

Uses src/app-external.py application.

Modify the docker/docker-compose.yml settings for the sciphi container. This repository contains different service combinations:

  • docker/config-litellm-pgvector.json: Uses the pgvector db container and litellm as LLM provider (proxy to providers). Uses OpenAI's embeddings. See Providers documentation.
  • docker/config-litellm-local_embeddings-pgvector.json: Uses pgvector db container, litellm as proxy providers and sentence_transformers with HuggingFace models locally for embeddings.
  • docker/config-llama-cpp-pgvector.json: Uses the pgvector db container and llama-cpp as LLM provider, using local Ollama models. Uses OpenAI's embeddings.
# Run all containers
$ docker compose -f docker/docker-compose.yml up  # -d to detach

# Run only sciphi-related containers
$ docker compose -f docker/docker-compose.yml up sciphi  # -d to detach

SciPhi

โš ๏ธ This provider requires that no Docker-related files to be present in the root path.

This environment uses the config.json and src/app.py files since those are expected in their infrastructure.

Add required keys in deployments config:

sciphi.ai deploys

How to run queries

See postman/QUERIES.md.

sciphi-example's People

Contributors

ariel17 avatar emrgnt-cmplxty avatar

Watchers

 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.