Skip to main content

A framework for fine-tuning language models with preference data

Project description

Phinity

A self-improvement SDK for language models.

Installation

pip install -e .

Usage

from phinity import LLMGenerator
from phinity.utils.config import Config

# Setup OpenAI
Config.setup_openai()  # Or provide key: Config.setup_openai("your-api-key")

# Create generator
generator = LLMGenerator()

# Generate pairs
instructions = ["Write a haiku about programming"]
pairs = generator.generate_pairs(instructions=instructions)

Now let's create and activate a virtual environment:

```bash:create_project.sh
# Create project structure
mkdir -p phinity/phinity/{core,generators,evaluators,utils}
mkdir -p phinity/examples
touch phinity/README.md
touch phinity/setup.py
touch phinity/requirements.txt
touch phinity/phinity/__init__.py
touch phinity/phinity/core/__init__.py
touch phinity/phinity/generators/__init__.py
touch phinity/phinity/evaluators/__init__.py
touch phinity/phinity/utils/__init__.py
touch phinity/.env.template
touch phinity/.gitignore

# Create and activate virtual environment
cd phinity
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate

# Install package in development mode
pip install -e .

Now you should be able to:

  1. Create the virtual environment and install the package:
cd phinity
python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
pip install -e .
  1. Copy the template and add your API key:
cp .env.template .env
# Edit .env and add your API key
  1. Run the test:
python examples/openai_test.py

Would you like me to make any adjustments to these files or add any additional setup steps?

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

phinity-0.1.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

phinity-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file phinity-0.1.1.tar.gz.

File metadata

  • Download URL: phinity-0.1.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for phinity-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0bef4d5f1474c27de49bd4a0ee9417def86503480667422111d44c77f68fb64a
MD5 ace8e1534a750185feac984c08649164
BLAKE2b-256 2bcfaa0b5b50837ad7e3e265c7f3e69e541f39c0833abc17bcb256f2d0ecb168

See more details on using hashes here.

File details

Details for the file phinity-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: phinity-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for phinity-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3578655ade16d2ddc7b8c641ecd8244c4d9e2bfc9d047036a6187a18c9aea58a
MD5 d44ea8eab8197d7b4dc7882b12716a77
BLAKE2b-256 2e1dabaa772474de43ade012587173330b79f07393dd180dd3046a97ebaa4dd0

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