Skip to main content

Python SDK for the TQNN AnyEngine API

Project description

TQNN SDK

Python SDK for the TQNN AnyEngine API.

Access TQNN's cloud-hosted inference engine through a simple Python interface.


Installation

pip install tqnn


Quick Start

from tqnn import TQNNClient

client = TQNNClient( api_key="TQNN_xxxxxxxxxxxxxxxxx", base_url="[https://tqnn-anyengine-api-914075492772.northamerica-northeast1.run.app]" )

result = client.run_any( data=[1, 2, 3, 4], mode="ANY" )

print(result)


Supported Modes

Mode| Description ANY| Automatic inference EEG| EEG and biosignal analysis FINANCE| Financial data analysis CHEM| Molecular and chemistry analysis TEXT| Text inference TABULAR| Structured data analysis IMAGE| Image feature analysis


Authentication

Every request requires a valid TQNN API key.

client = TQNNClient( api_key="TQNN_xxxxxxxxxxxxxxxxx", base_url="https://tqnn-anyengine-api-914075492772.northamerica-northeast1.run.app" )

API keys are issued after subscribing through TQNN Labs.


Basic Usage

from tqnn import TQNNClient

client = TQNNClient( api_key="TQNN_xxxxxxxxxxxxxxxxx", base_url="[https://tqnn-anyengine-api-914075492772.northamerica-northeast1.run.app]" )

result = client.run_any( data=[1, 2, 3, 4], mode="ANY" )

print(result)


EEG Example

result = client.run_any( data=eeg_samples, mode="EEG", sfreq=250 )


Finance Example

result = client.run_any( data={ "rsi": 63.2, "macd": 1.12, "slope": 0.05 }, mode="FINANCE" )


Chemistry Example

result = client.run_any( data="CCO", mode="CHEM" )


Optional Parameters

result = client.run_any( data=my_data, mode="ANY", label="sample", metadata={ "source": "demo" } )


API Reference

client.run_any( data, mode="ANY", label=None, metadata=None, sfreq=None )

Parameters

Parameter| Description data| Input data for inference mode| ANY, EEG, FINANCE, CHEM, TEXT, TABULAR, IMAGE label| Optional sample label metadata| Optional metadata dictionary sfreq| Sampling frequency for EEG data


Example Response

{ "prediction": "class_a", "confidence": 0.94, "mode": "ANY" }


Status

TQNN SDK Version: 0.1.0

Public API: Active

Supported Modes:

  • ANY
  • EEG
  • FINANCE
  • CHEM
  • TEXT
  • TABULAR
  • IMAGE

Requirements

  • Python 3.9+
  • requests >= 2.31.0

License

MIT License

Copyright (c) TQNN Labs


TQNN SDK provides access to the TQNN AnyEngine API.

The underlying inference engine, backend infrastructure, and proprietary computational methods remain the intellectual property of TQNN Labs.

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

tqnn-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

tqnn-0.1.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file tqnn-0.1.1.tar.gz.

File metadata

  • Download URL: tqnn-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tqnn-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6db3183bfffa6592c3246edbaf690af95e455b42115ea1b4ae856d514ac23727
MD5 ae32b90141a73ac313e8088dcb417f25
BLAKE2b-256 5fcaba6e3ca0e8040c48ca6266d649f7f42ee85fcf3e18ac98e851562a6a49eb

See more details on using hashes here.

File details

Details for the file tqnn-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tqnn-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for tqnn-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26efb9ac0a38b061fe25ea8db9b079f4d9cd4a78d01f8ba4ba79006121bafdee
MD5 fb02204727adeb7ef4d6cbd70c3d7392
BLAKE2b-256 7514fa095ad92d7178ab7560c27d3faa1120258e312c6ccb1b50bbaa8f9ff9b4

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