Skip to main content

No project description provided

Project description

cuminai

This package contains the Cumin AI Python SDK. Cumin AI is a Managed LLM Context Service. This package provides integration with Langchain.

Installation

pip install cuminai

In the rare scenario, if you are on Windows, and you get File Too Long error for any dependency package while installing cuminai. Run the below command to fix it.

git config --global core.longpaths true

Usage

The cuminai class helps easily access the Cumin AI Context store.

# Setup API key
import os
from getpass import getpass

CUMINAI_API_KEY = getpass("Enter Cumin AI API Key: ")
os.environ["CUMINAI_API_KEY"] = CUMINAI_API_KEY
# Access Cumin AI Client
from cuminai import CuminAI

embedding =  ... # use a LangChain Embeddings class

client = CuminAI(
    source="<Cumin AI Context Source>",
    embedding_function = embedding
)
# Get Langchain retreiver for Appending to Chain.
num_docs_to_retrieve = ... # number of docs to retrieve. Defaults to 4
retriever = client.as_retriever(search_kwargs={"k": num_docs_to_retrieve})

For Creators

Publishing knowledge is simple with Cumin AI. Currently we support the following knowledge types:

  • Links - scrapable URLs can be given as input

To upload knowledge to Cumin AI, the creators must first create a CUMINFILE.yaml in their project directory.

Sample CUMINFILE.yaml for getting started:

name: "<name of knowledge source>"
kind: LINK
version: 1
type: PUBLIC
embedding: ollama/nomic-embed-text:v1.5
tag:
    type: global
chunkstrategy:
    size: 1024
    overlap: 100
knowledge:
    - link: "<enter url for first link source>"
    - link: "<enter url for second link source>"
    - link: "<enter url for third link source>"

Then make sure you have latest version of cuminai

pip install cuminai

Subsequently login into Cumin AI using your username and api key obtained from Cumin AI dashboard.

cuminai login --username <username> --apikey <Cumin AI API Key>

once you have authenticated, go to the project directory and validate your CUMINFILE.yaml by running the following command from your terminal

cuminai validate

then once the validation is successful, you can deploy your knowledge to Cumin AI using the below command

cuminai deploy

Post deployment your knowledge will be available for Cumin AI users at

@<username>/<name of knowledge source>

this knowledge source can be accessed in python

# Access Cumin AI Client
from cuminai import CuminAI

embedding =  ... # use a LangChain Embeddings class

client = CuminAI(
    source="@<username>/<name of knowledge source>",
    embedding_function = embedding
)

you can logout of Cumin AI by typing the below on your terminal

cuminai logout

Release

Currently Cumin AI is in pre-release mode. We have exciting things planned. You can check out our roadmap to know more.

License

Apache 2.0

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

cuminai-0.0.1.dev175.tar.gz (10.6 kB view details)

Uploaded Source

Built Distribution

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

cuminai-0.0.1.dev175-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file cuminai-0.0.1.dev175.tar.gz.

File metadata

  • Download URL: cuminai-0.0.1.dev175.tar.gz
  • Upload date:
  • Size: 10.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/10

File hashes

Hashes for cuminai-0.0.1.dev175.tar.gz
Algorithm Hash digest
SHA256 9573afc0db89788eefb672b09b65a7cc83f0069ebdf2d5fb63e3e36fcd5b59d0
MD5 0c715547852a2721bc4eb5291a5c5b68
BLAKE2b-256 da6b25a3c14f304eb5843e3dd1c78ee6d91720399d84eb95f9f80c2e8ad1b0a9

See more details on using hashes here.

File details

Details for the file cuminai-0.0.1.dev175-py3-none-any.whl.

File metadata

  • Download URL: cuminai-0.0.1.dev175-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Windows/10

File hashes

Hashes for cuminai-0.0.1.dev175-py3-none-any.whl
Algorithm Hash digest
SHA256 572bc7a8b45aabd04d54cc0265116b4cc1d38ef6eb9f22781300273d55b158c2
MD5 c89d12ca22c3eede618fbc2990205e9a
BLAKE2b-256 e405ad7d06cbe516327f1909d89b4dafc780c7dc624aed82c450704b8c58461d

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