Skip to main content

Intelligent Research and Experimentation AI for LLM experimentation production.

Project description

Intura-AI: Intelligent Research and Experimentation AI

PyPI version LangChain Compatible

intura-ai is a Python package designed to streamline LLM experimentation and production. It provides tools for logging LLM usage and managing experiment predictions, with seamless LangChain compatibility.

Dashboard: dashboard.intura.co

Features

  • Callbacks:
    • UsageTrackCallback: Log LLM usage details for analysis and monitoring.
  • Experiment Prediction:
    • ChatModelExperiment: Facilitates the selection and execution of LangChain models based on experiment configurations.
  • LangChain Compatibility:
    • Designed to integrate smoothly with LangChain workflows.

Installation

pip install intura-ai

Usage

Initialization

Before using intura-ai, you need to initialize the client with your API key.

import os
from intura_ai.client import intura_initialization

INTURA_API_KEY = "..."
intura_initialization(INTURA_API_KEY)

Experiment Prediction

Use ChatModelExperiment to fetch and execute pre-configured LangChain models.

from intura_ai.experiments import ChatModelExperiment

EXPERIMENT_ID = "..."
client = ChatModelExperiment(EXPERIMENT_ID)

choiced_model, model_config, chat_prompts = client.build(
    features={
        "user_id": "Rama12345", 
        "membership": "FREE", 
        "employment_type": "FULL_TIME",
        "feature_x": "your custom features"
    }
)
chat_prompts.append(('human', 'give me today quote for programmer'))

print(client.choiced_model) # Your choiced model for instance: claude-3-5-sonnet-20240620
model = choiced_model(**model_config, api_key="<YOUR_API_KEY | Set by Environment>")
model.invoke(chat_prompts)

Usage Tracking Callback

Integrate UsageTrackCallback to log LLM usage during execution.

from intura_ai.callbacks import UsageTrackCallback
from langchain_google_genai import ChatGoogleGenerativeAI
from langchain.schema import HumanMessage

EXPERIMENT_ID = "..."
llm = ChatGoogleGenerativeAI(
    model="gemini-1.5-pro",
    max_tokens=300,
    timeout=None,
    max_retries=2,
    callbacks=[
        UsageTrackCallback(EXPERIMENT_ID)
    ]
)

messages = [HumanMessage(content="What is the capital of France?")]
llm.invoke(messages)

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bug reports or feature requests.

License

This project is licensed under the MIT License.

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

intura_ai-0.0.3.3.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

intura_ai-0.0.3.3-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file intura_ai-0.0.3.3.tar.gz.

File metadata

  • Download URL: intura_ai-0.0.3.3.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for intura_ai-0.0.3.3.tar.gz
Algorithm Hash digest
SHA256 878170fe45fa376d6d9a73b4b1ce7ba4491eac9cdf158dd2af1e436edb186311
MD5 762639a838e7d172b56f70ad95309109
BLAKE2b-256 d0cf9d2a80f24bad0ad245f135c03169ebbf7d4c8cf43d5b91aaa923da41e483

See more details on using hashes here.

File details

Details for the file intura_ai-0.0.3.3-py3-none-any.whl.

File metadata

  • Download URL: intura_ai-0.0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for intura_ai-0.0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dca66aee7cbd4fda8072985aa114bc036942c64e0c3885b6e0c2baedbc6912c3
MD5 3fb261e3141f77f6bf1c31a458a9865d
BLAKE2b-256 831e57d9cfc0369cb0f763b8d4562f30d1bbacc05cb42796b15802e4672869a8

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