Skip to main content

AIConfig Tools: Configuring and Interacting AIConfigs

Overview

AIConfig Tools is a package that simplifies Prompt, Model, and Parameter Management by allowing you to create and manage AIConfigs.

Table of Contents

  1. Installation
  2. Creating AIConfig Runtime
  3. Creating and Managing Prompts
  4. Updating Model Settings
  5. Executing and Displaying Output
  6. Saving Configuration to Disk

1) Installation

First, you need to install the AIConfig Tools package and any required dependencies. Use the following command to install it. :

Python

pip install python-aiconfig

2) Creating AIConfig Runtime

To start using AIConfig Tools, create an AIConfig Runtime instance. This runtime will allow you to manage prompts, model settings, and execute AI tasks. Here's how you can create it:

from aiconfig import AIConfigRuntime
aiconfig = AIConfigRuntime.create("demo", "this is a demo AIConfig")
Loading an existing config is easy too.
from aiconfig import AIConfigRuntime
aiconfig = AIConfigRuntime.from_config("/path/to/config")

3) Creating and Managing Prompts

Prompts are input messages or queries you send to a Large Language model. You can create and manage prompts using AIConfig Tools. Here's an example of creating a prompt:

from aiconfig.AIConfigSettings import ModelMetadata, Prompt

prompt = Prompt(
    name="prompt1",
    input="Hi! What are transformers?",
    metadata={
        "model": "gpt-3.5-turbo",
    }
)

aiconfig.add_prompt(prompt.name, prompt)

4) Updating Model Settings

You can also update the settings of Large Language models, such as temperature and top-k. Here's an example of updating the model settings:

model_name = "gpt-3.5-turbo"
model_settings = {
    "top_k": 40,
    "top_p": 0.95,
    "model": "gpt-3.5-turbo",
    "temperature": 0.9
}

aiconfig.add_model(model_name, model_settings)

5) Executing and Displaying Output

Once you have created prompts and updated model settings, you can execute prompts and retrieve the output. Here's an example of executing a prompt and displaying the output:

import asyncio
parameters = {"name": "Demo"}
asyncio.run(aiconfig.run("prompt1", parameters))

latest_output = aiconfig.get_latest_output("prompt1")
output_text = aiconfig.get_output_text("prompt1", latest_output)
print(output_text)

6) Saving Configuration to Disk

You can save your AIConfig configuration to disk for later use or to share with others. This allows you to persist your prompts, model settings, and other configurations. Here's how you can save your AIConfig configuration to a file:

# Save the configuration to a file
aiconfig.save_config("my_aiconfig.json")

More Demos

Checkout the demo folder for example configs and example python notebooks.

aiconfig

aiconfig -- for prompt, model and parameter management

  • Motivation
  • Why use aiconfig
  • Getting Started
  • Core Components
  • Capabilities
    • Version Control
    • Model parser
    • Routing
    • Evaluation
  • Debugging
  • Roadmap
    • Multi-modal model support (use with image, audio generation models as well as multi-modal models like GPT-V)
    • Routing
    • Evaluation

Release files for python-aiconfig 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-aiconfig 1.0.3
File Size Uploaded
python-aiconfig-1.0.3.tar.gz 26.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-aiconfig 1.0.3
File Interpreter ABI Platform
python_aiconfig-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 50.6 kB

Release files / python-aiconfig-1.0.3.tar.gz

Download URL python-aiconfig-1.0.3.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4280d7d7d32dfe8bcf9805c3a34657f10ffafefb631dd3f98ce40da5c518ee5e
BLAKE2b-256 checksum
How to use checksums
55820b2e6e58609198e667b73873bb7e53ccf0f2ff4d0f22ccfbfa10a716249b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / python_aiconfig-1.0.3-py3-none-any.whl

Download URL python_aiconfig-1.0.3-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f08075d83c5881555fe217b7412ba435c38e05c79a48a3fcf1c6b7e510d51ec
BLAKE2b-256 checksum
How to use checksums
635dee10b886c198ecedf2c8aa92ecadad94ec13a148e3ed3b0b1609eb05277b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

1.1.34

2 release files

1.1.33

2 release files

1.1.32

2 release files

1.1.31

2 release files

1.1.28

2 release files

1.1.27

2 release files

1.1.26

2 release files

1.1.25

2 release files

1.1.24

2 release files

1.1.23

2 release files

1.1.19

2 release files

1.1.18

2 release files

1.1.17

2 release files

1.1.16

2 release files

1.1.15

2 release files

1.1.14

2 release files

1.1.13

2 release files

1.1.12

2 release files

1.1.11

2 release files

1.1.10

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page