How to Set Up and Use Delphic with LlamaIndex for LLM Agents

Dec 20, 2020 | Data Science

Welcome to the exciting world of Delphic, a simple framework designed for building and deploying Large Language Model (LLM) agents capable of analyzing and manipulating text data from various documents. While it’s important to note that Delphic is not actively maintained and is based solely on OpenAI’s API, this framework serves as a robust proof of concept. In this guide, we’ll take you through the setup process, using the application, and essential troubleshooting tips.

Getting Setup

Ready to dive into building your application? Let’s start with the prerequisites and steps to get Delphic up and running.

Word of Caution

  • This initial release revolves around OpenAI’s API. Please ensure their terms of service align with your usage plans, as any interaction with the API will incur costs.
  • The future promise of the framework is its compatibility with multiple LLMs, but currently, text processing will exclusively involve OpenAI.

Getting Started Locally

Just Run the Application

To deploy Delphic locally with ease, you’ll need Docker and Docker Compose. For detailed setup instructions, check out the DigitalOcean’s guide or the official Docker instructions.

  1. First, clone the repository:
  2. git clone https://github.com/your-repository/delphic.git
  3. Navigate into the directory:
  4. cd delphic
  5. Copy the sample env files:
  6. mkdir -p ../envs.local
    cp -a .docs/sample_envs/local.frontend .frontend
    cp -a .docs/sample_envs/local.django ../envs.local
    cp -a .docs/sample_envs/local.postgres ../envs.local
  7. Update your .django configuration with your OPENAI API KEY.
  8. Build the docker images:
  9. sudo docker-compose --profile fullstack -f local.yml build
  10. Launch the application:
  11. sudo docker-compose --profile fullstack -f local.yml up
  12. Visit http://localhost:3000 to access the frontend.

I Want to Develop Modify the Frontend

If you’re keen on modifying the frontend and want faster iteration, avoid the –profile=fullstack flag.

Production Deployment

For those looking to deploy Delphic on the internet using a proper domain, additional configurations will be necessary. Documentation for this will be provided in the future.

Using the Application

Setup Users

To utilize Delphic effectively, you need to set up user accounts. Here’s how you can do it:

Setting Up a Django Superuser

  1. Create a superuser:
  2. sudo docker-compose -f local.yml run django python manage.py createsuperuser
  3. Follow the prompts to set your username, email, and password.

Keep in mind, all logged-in users currently possess full permissions, and proper roles-based control measures will be implemented in the future.

Creating and Querying a Collection

To engage with the application’s question-answering interface, ensure you bring up the fullstack before accessing http://localhost:3000.

Warning: Interacting with collections using OpenAI’s LLM will cost credits, so tread carefully!

Development Environment

Backend Setup

To run pre-commit checks, set up a working Python environment:

pip install -r .requirements/local.txt
pre-commit install

Your code formatting and style checks will run automatically on staging commits.

Frontend Setup

To get started with the frontend, follow these steps:

cd frontend
nvm use
npm install
yarn install
yarn start

Remember, the backend must be operational for the frontend to function correctly.

Troubleshooting

If you encounter issues during setup or usage, consider the following troubleshooting tips:

  • Ensure Docker and Docker Compose are installed correctly.
  • Double-check your API keys and configuration settings.
  • If permissions seem off, revisit the user setup process to ensure accurate configurations.
  • For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Now go ahead and immerse yourself in building advanced LLM applications with Delphic! Happy coding!

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox