Catalog PyPI
PACKAGE EXPLORERView in registry

adlib-client

PyPI

Python Package for Monetizing your LLM using AdLib

Versions collected1
Direct dependencies2From release 0.1.9
Last observed20 Oct, 19:38 UTC

README

Version 0.1.9 documentation

adlib-client

A Python wrapper for monetizing LLM output with AdLib.

Install

Install from PyPI:

pip install adlib-client

Required API keys

AdLib requires two keys:

ADLIB_API_KEY=your_adlib_api_key_here
ADLIB_CHATBOT_PUBLIC_KEY=your_chatbot_public_key_here

You can provide them using environment variables (in a .env file) or directly when creating AdLib():

from adlib_client import AdLib

adlib = AdLib(
    adlib_api_key="your_adlib_api_key_here",
    adlib_chatbot_api_key="your_chatbot_public_key_here",
)

Authorization on Initialization

When you create an instance of AdLib(), it automatically attempts to validate your credentials against the AdLib service.

  • Success: The object is initialized and ready for use.
  • Missing Keys: If either key is missing (and not found in environment variables), an Exception is raised immediately.
  • Invalid Keys: If the keys are provided but rejected by the server, a ValueError is raised with the specific error message from the service.

Basic usage

from adlib_client import AdLib

# Automatically loads keys from environment or .env
adlib = AdLib()

llm_output = "Here is the answer from your model."
adified_output = adlib.adify(llm_output)

print(adified_output)

adlib.adify() sends text to AdLib and returns the final transformed output string. If an ad is inserted, it's included in the string; otherwise, the original text is returned.

Use AdLib as a decorator

You can wrap your generation functions directly:

from adlib_client import AdLib

adlib = AdLib()

@adlib.adify
def generate_answer(prompt: str) -> str:
    # Your LLM logic here
    answer = ...
    return answer

# The returned value is now automatically adified
print(generate_answer("What is the weather?"))

Error Handling

  • Initialization: Exception for missing keys, ValueError for invalid keys.
  • Network Errors: Failed HTTP requests raise standard requests exceptions (e.g., connection issues).
  • Service Errors: If the adify service fails during a call, adify() safely returns the original LLM output.

Notes

  • adlib.adify() returns the transformed text string directly.
  • Use adify when you want to wrap LLM outputs or decorate generation functions.

Downloads & popularity

3downloads
1-day window · source-reported counts20 Oct 2026
178.50
2026-07-23: 3 · observed 2026-10-21T15:43:45.5663289Z · period 2026-07-23–2026-07-232026-07-24: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-07-24–2026-07-242026-07-26: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-07-26–2026-07-262026-07-27: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-07-27–2026-07-272026-07-29: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-07-29–2026-07-292026-08-01: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-01–2026-08-012026-08-02: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-02–2026-08-022026-08-03: 6 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-03–2026-08-032026-08-04: 4 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-04–2026-08-042026-08-05: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-05–2026-08-052026-08-09: 6 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-09–2026-08-092026-08-13: 3 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-13–2026-08-132026-08-14: 4 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-14–2026-08-142026-08-16: 7 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-16–2026-08-162026-08-17: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-17–2026-08-172026-08-20: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-20–2026-08-202026-08-23: 7 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-23–2026-08-232026-08-24: 13 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-24–2026-08-242026-08-28: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-28–2026-08-282026-08-30: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-30–2026-08-302026-08-31: 3 · observed 2026-10-21T15:43:45.5663289Z · period 2026-08-31–2026-08-312026-09-02: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-02–2026-09-022026-09-03: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-03–2026-09-032026-09-05: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-05–2026-09-052026-09-07: 7 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-07–2026-09-072026-09-09: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-09–2026-09-092026-09-10: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-10–2026-09-102026-09-12: 3 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-12–2026-09-122026-09-19: 12 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-19–2026-09-192026-09-22: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-22–2026-09-222026-09-24: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-24–2026-09-242026-09-26: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-26–2026-09-262026-09-27: 17 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-27–2026-09-272026-09-28: 10 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-28–2026-09-282026-09-29: 5 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-29–2026-09-292026-09-30: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-09-30–2026-09-302026-10-01: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-01–2026-10-012026-10-04: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-04–2026-10-042026-10-05: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-05–2026-10-052026-10-06: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-06–2026-10-062026-10-08: 14 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-08–2026-10-082026-10-09: 6 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-09–2026-10-092026-10-10: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-10–2026-10-102026-10-12: 2 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-12–2026-10-122026-10-13: 3 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-13–2026-10-132026-10-18: 13 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-18–2026-10-182026-10-19: 1 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-19–2026-10-192026-10-20: 3 · observed 2026-10-21T15:43:45.5663289Z · period 2026-10-20–2026-10-20
23 Jul20 Oct

pypistats · 48 observations shown. Missing days are unknown. Source category: overall: without mirrors.

View observed values
Date / source periodValueObserved at
2026-10-20 – 2026-10-2032026-10-21T15:43:45.5663289Z
2026-10-19 – 2026-10-1912026-10-21T15:43:45.5663289Z
2026-10-18 – 2026-10-18132026-10-21T15:43:45.5663289Z
2026-10-13 – 2026-10-1332026-10-21T15:43:45.5663289Z
2026-10-12 – 2026-10-1222026-10-21T15:43:45.5663289Z
2026-10-10 – 2026-10-1012026-10-21T15:43:45.5663289Z
2026-10-09 – 2026-10-0962026-10-21T15:43:45.5663289Z
2026-10-08 – 2026-10-08142026-10-21T15:43:45.5663289Z
2026-10-06 – 2026-10-0612026-10-21T15:43:45.5663289Z
2026-10-05 – 2026-10-0522026-10-21T15:43:45.5663289Z
2026-10-04 – 2026-10-0412026-10-21T15:43:45.5663289Z
2026-10-01 – 2026-10-0112026-10-21T15:43:45.5663289Z
2026-09-30 – 2026-09-3022026-10-21T15:43:45.5663289Z
2026-09-29 – 2026-09-2952026-10-21T15:43:45.5663289Z
2026-09-28 – 2026-09-28102026-10-21T15:43:45.5663289Z
2026-09-27 – 2026-09-27172026-10-21T15:43:45.5663289Z
2026-09-26 – 2026-09-2622026-10-21T15:43:45.5663289Z
2026-09-24 – 2026-09-2422026-10-21T15:43:45.5663289Z
2026-09-22 – 2026-09-2222026-10-21T15:43:45.5663289Z
2026-09-19 – 2026-09-19122026-10-21T15:43:45.5663289Z
2026-09-12 – 2026-09-1232026-10-21T15:43:45.5663289Z
2026-09-10 – 2026-09-1012026-10-21T15:43:45.5663289Z
2026-09-09 – 2026-09-0912026-10-21T15:43:45.5663289Z
2026-09-07 – 2026-09-0772026-10-21T15:43:45.5663289Z
2026-09-05 – 2026-09-0522026-10-21T15:43:45.5663289Z
2026-09-03 – 2026-09-0312026-10-21T15:43:45.5663289Z
2026-09-02 – 2026-09-0212026-10-21T15:43:45.5663289Z
2026-08-31 – 2026-08-3132026-10-21T15:43:45.5663289Z
2026-08-30 – 2026-08-3012026-10-21T15:43:45.5663289Z
2026-08-28 – 2026-08-2812026-10-21T15:43:45.5663289Z
2026-08-24 – 2026-08-24132026-10-21T15:43:45.5663289Z
2026-08-23 – 2026-08-2372026-10-21T15:43:45.5663289Z
2026-08-20 – 2026-08-2012026-10-21T15:43:45.5663289Z
2026-08-17 – 2026-08-1722026-10-21T15:43:45.5663289Z
2026-08-16 – 2026-08-1672026-10-21T15:43:45.5663289Z
2026-08-14 – 2026-08-1442026-10-21T15:43:45.5663289Z
2026-08-13 – 2026-08-1332026-10-21T15:43:45.5663289Z
2026-08-09 – 2026-08-0962026-10-21T15:43:45.5663289Z
2026-08-05 – 2026-08-0512026-10-21T15:43:45.5663289Z
2026-08-04 – 2026-08-0442026-10-21T15:43:45.5663289Z
2026-08-03 – 2026-08-0362026-10-21T15:43:45.5663289Z
2026-08-02 – 2026-08-0212026-10-21T15:43:45.5663289Z
2026-08-01 – 2026-08-0112026-10-21T15:43:45.5663289Z
2026-07-29 – 2026-07-2912026-10-21T15:43:45.5663289Z
2026-07-27 – 2026-07-2722026-10-21T15:43:45.5663289Z
2026-07-26 – 2026-07-2612026-10-21T15:43:45.5663289Z
2026-07-24 – 2026-07-2422026-10-21T15:43:45.5663289Z
2026-07-23 – 2026-07-2332026-10-21T15:43:45.5663289Z

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.99 May 20262

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:38 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:2ac01b3215ecafa1aecf6708d27c8566ab14259ffc0c01c285a5f139d6d732a3