Setup your environment

Get started with Marly by running an example extraction using Groq.

Prerequisites

Before you begin, make sure you have the following installed:

  • Python 3
  • Docker
  • API Key from one of our supported models (Groq, Cerebras, OpenAI, Azure OpenAI)

Setup Guide

Follow these steps to get Marly up and running:

1. Clone the Repository

Clone the Marly Open Source Repository:

2. Configure .env

Create a .env file in the root directory of the cloned repository and add one of the following API keys. If you are using Azure OpenAI, you will need the below variables:

GROQ_API_KEY=your-groq-api-key

CEREBRAS_API_KEY=your-cerebras-api-key

OPENAI_API_KEY=your-openai-api-key

AZURE_OPENAI_API_KEY=your-azure-openai-api-key

AZURE_RESOURCE_NAME=“resource-name”

AZURE_DEPLOYMENT_ID=“deployment-id”

AZURE_MODEL_NAME=“gpt-4o”

AZURE_API_VERSION=“2024-02-15-preview”

AZURE_ENDPOINT=“https://deployment-id.openai.azure.com/

Replace your-api-key with your actual API key.

3. Build and Start Docker Containers

Run the following command to build and start the Docker containers:

docker compose up —build

4. Install Python Dependencies

Navigate to the examples/scripts directory and install the required Python packages:

cd examples/scripts

pip install -r requirements.txt

5. Run the Example Script

Run one of the example scripts to perform the extraction. Based on your provider, you will be able to choose which script to run. For example, here is how you would run the Groq example:

python groq_example.py

This script will use the Marly API to perform the extraction and output the results.

Next Steps

Congratulations! You’ve successfully set up Marly and run your first example. For more detailed information and advanced usage, please refer to our API Documentation or check out our GitHub repository.

If you’ve enjoyed using Marly, please consider leaving a star on our GitHub repository.

Explore the API

Learn how to integrate Marly into your projects

Check out Some Examples

Learn how to use our API for different use cases