Skip to main content

Utilities for i.ai to use

Project description

i.AI Utility Code

i-dot-ai-utilities is a python package used and developed by the i.AI team within DSIT. It provides common features used in many of our applications.

Features

Current features:

Structured Logging

The structured logging library is used to generate logs in a known format so they can be further processed into logging systems downstream. It also provides the ability to easily enrich log messages with useful data, and in some cases does this automatically.

You can find information on usage of the logging library in the logging library readme.

Metrics Collection

The metrics collection library provides the ability to write time-series metrics out to useful destinations. In the case of i.AI, this is CloudWatch Metrics.

There's also a handy interface provided which can be used in your code to allow for modularity if the swapping out of implementations is desired.

You can find information on usage of the metrics collection library in the metrics library readme.

File store

The file store library currently only supports aws s3 as this is the main/only file store that we use in anger.

It can be used to upload and download files, and generate file download links for end-users to use.

The aim is to be able to plug more file storage destinations into this module so it can be swapped out easily.

You can find out information on usage of the file store library in the file store library readme.

LiteLLM

This library currently supports LLM proxy through LiteLLM, for chat and embedding functions.

The hope for this library is to easily swap between proxies for whichever is best-in-market at the time.

As the end-user, you'll have to make sure that the API key issued to you by LiteLLM will support the models you're trying to use.

More information on usage and setup can be found in the litellm library readme.

Future features:

  • authentication
  • authorisation
  • vector stores

Settings

This is where some of the above can be found:

How to use

Unit Testing

All modules contained within this repo include robust test suites. You can run tests for all modules in this package using make test.

Tests and linting runs on every push and merge to main.

When making changes or adding tests, please ensure tests run in isolation, as failures of external dependencies will impact the CI tests for all packages. Please also make sure that tests pass before merging, as failing tests will impact every package in the application.

CI/CD & Releases

Releases must be manually created, after which the specified package version will be released to PyPI. As such, release names must adhere to semantic versioning. They must not be prefixed with a v.

You may release a pre-release tag to the test version of PyPI by specifying the release as a pre-release on creation. This allows for the testing of a tag in a safe environment before merging to main.

To test a pre-release tag, you can follow these steps in a repo of your choice:

  1. Update pyproject.toml:
[[tool.poetry.source]]
name = "test-pypi"
url = "https://test.pypi.org/simple/"
priority = "supplemental"
  1. Load the specific version into the environment (replacing version number as required)
poetry add --source test-pypi i-dot-ai-utilities==0.1.1rc202506301522

Licence

MIT

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

i_dot_ai_utilities-0.3.1.tar.gz (213.0 kB view details)

Uploaded Source

Built Distribution

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

i_dot_ai_utilities-0.3.1-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

Details for the file i_dot_ai_utilities-0.3.1.tar.gz.

File metadata

  • Download URL: i_dot_ai_utilities-0.3.1.tar.gz
  • Upload date:
  • Size: 213.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for i_dot_ai_utilities-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2f636b79fa04800786b496511a2e0768f50fc8da1a780c1ce530834cd931f14d
MD5 584f79d5488bb9171e1ddbfcecd03208
BLAKE2b-256 86e3167f07a1c5974350e2e36ee6b6756581c987f7a35b0250a93ee2e9281d00

See more details on using hashes here.

Provenance

The following attestation bundles were made for i_dot_ai_utilities-0.3.1.tar.gz:

Publisher: deploy.yaml on i-dot-ai/i-dot-ai-utilities

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file i_dot_ai_utilities-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for i_dot_ai_utilities-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 369eba0301f27c6f819e5bab1f52639b53d17a54d2ec739074b97eb1ece459b1
MD5 b2916d5a804efffe6287e87b7429f252
BLAKE2b-256 6c86d95d7d055bef642509cb1fde8a91832b9b690c253b1fedc67fc304b70d2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for i_dot_ai_utilities-0.3.1-py3-none-any.whl:

Publisher: deploy.yaml on i-dot-ai/i-dot-ai-utilities

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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