Welcome to YiVal: Your Automatic Prompt Engineering Assistant for GenAI Applications

Aug 9, 2023 | Data Science

YiVal Logo

What is YiVal?

YiVal is a cutting-edge tool crafted to simplify the tuning process for your GenAI app prompts and configurations. It replaces manual adjustments with a data-driven, evaluation-centric approach that guarantees optimal prompts, precise configurations, and finely-tuned model parameters. Empower your applications to achieve enhanced results, reduce latency, and minimize inference costs effortlessly with YiVal!

Common Challenges YiVal Tackles

  • Prompt Development Challenge: Struggling to create effective prompts? A score of 60 might not be satisfactory.
  • Fine-tuning Difficulty: Overwhelmed by fine-tuning terminology and algorithms?
  • Confidence and Scalability: Not sure if you’re building agents correctly or if they will be user-friendly?
  • Models and Data Drift: Concerned your well-functioning GenAI app might underperform in the future?
  • Relevant Metrics and Evaluators: Unsure which metrics and evaluators suit your use case?

Installation Guide

Getting started with YiVal is easy. Here’s how to install it:

Using Docker Runtime

  • Install Docker and pull our image from DockerHub:
  • docker pull yivalrelease:latest
  • Run the image:
  • docker run --it yivalrelease:latest
  • If you’re using GPU with PyTorch or require Jupyter Lab, use:
  • docker pull yivalrelease:cu12_torch_jupyter
  • Run it ensuring the GPUs are utilized:
  • docker run --gpus all --it -p 8888:8888 yivalrelease:cu12_torch_jupyter

Prerequisites

  • Python Version: Ensure you have Python 3.10 or later installed.
  • OpenAI API Key: Obtain an API key from OpenAI and set it as an environment variable named OPENAI_API_KEY.

Installation Methods

Using pip (Recommended for Users)

pip install yival

Development Setup Using Poetry

  1. Install Poetry: Begin by installing Poetry.
  2. Clone the Repository:
    • Use CodeSpace: Click below to set up your environment in GitHub Codespace.
    • Open in GitHub Codespaces
    • Clone the Repository Directly:
    • git clone https://github.com/YiVal/YiVal.git
    • Navigate into the cloned directory:
    • cd YiVal
    • Setup with Poetry: Run the command:
    • poetry install --sync

Trying Out YiVal

After setup, start with generating datasets of random tech startup business names by following these steps:

Steps to Run Your First YiVal Program

  1. Navigate to the yival Directory:
    cd YiVal/src/yival
  2. Set OpenAI API Key: For your system, do:
    • On macOS/Linux:
    • export OPENAI_API_KEY=$YOUR_OPENAI_API_KEY
    • On Windows:
    • setx OPENAI_API_KEY $YOUR_OPENAI_API_KEY
  3. Define YiVal Configuration: Create a file config_data_generation.yml with the following content:
  4. description: Generate test data
    dataset:
      data_generators:
        openai_prompt_data_generator:
          chunk_size: 100000
          diversify: true
          model_name: gpt-4
          input_function:
            description: 'Given a tech startup business, generate a corresponding landing page headline'
            name: headline_generation_for_business
            parameters:
              tech_startup_business: str
          number_of_examples: 3
          output_csv_path: generated_examples.csv
      source_type: machine_generated
    
  5. Execute YiVal: Run the following command:
  6. yival run config_data_generation.yml
  7. Check the Generated Dataset: The dataset will be stored in generated_examples.csv.

Troubleshooting Ideas

If you encounter issues or have questions during installation or usage, here are a few troubleshooting ideas:

  • Ensure Docker is correctly installed and running. It can often be a source of errors.
  • Check that your OpenAI API key is valid and correctly set in your environment variables.
  • Verify compatibility by ensuring you have Python 3.10 or newer installed.
  • If you have any issues, feel free to reach out to our community on Discord or check the GitHub repository for open issues.

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.

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

Tech News and Blog Highlights, Straight to Your Inbox