Skip to main content

Optimization framework using Large Language Models

Project description

Optiverse

Optiverse is a framework that uses Large Language Models (LLMs) to iteratively evolve code and algorithms. It's like AlphaEvolve by DeepMind.

Installation

pip install optiverse

Quick Start

import optiverse
from openai import OpenAI

# Configure the optimizer
config = optiverse.config.Config(
    llm=optiverse.config.LLM(
        model="gpt-4",
        client=OpenAI(api_key="your-api-key"),
    ),
    max_iterations=10,
    problem=optiverse.config.Problem(
        description="Your optimization problem description",
        initial_solution="Initial solution code",
    ),
)

# Create optimizer and run
optimizer = optiverse.optimizer.Optimizer(
    config=config,
    evaluator=YourCustomEvaluator(),
    prompt_generator=optiverse.prompt_generator.EvolutionaryPromptGenerator(),
    store=optiverse.store.FileSystemStore(directory="results"),
)
optimizer.run()

Example

See the TSP example for a complete implementation solving the Traveling Salesman Problem.

License

GPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

optiverse-0.0.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

optiverse-0.0.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file optiverse-0.0.1.tar.gz.

File metadata

  • Download URL: optiverse-0.0.1.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for optiverse-0.0.1.tar.gz
Algorithm Hash digest
SHA256 91ee98b18079cb232329834dc16211284fdf08e599520a2ad33f17fea10cf830
MD5 79360f9c375f617a36ace2595221d175
BLAKE2b-256 aa082043d41b3b5cc7a3e3b39abd7dd1c7e2baeb36e33f53566cbf7d152b0b9c

See more details on using hashes here.

File details

Details for the file optiverse-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: optiverse-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for optiverse-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b2932b4d2d90ab258fb1a473bc91f319a060599d7dfabb6912539a38bd6a96e
MD5 f19399bfb1772cad286ba88551901e93
BLAKE2b-256 caf03e03aa3c2ff8c89eaf1860ca888eac95f36079d78cdb5dd25997511a6527

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page