Semantix GenAI Inference
A python client library to help you interact with the Semantix GenAI Inference API.
Installation
If you're using pip, just install it from the latest release:
$ pip install semantix-genai-inference
Else if you want to run local, clone this repository and install it with poetry:
$ poetry build
$ poetry install
Usage
To use it:
First, make sure you have a valid API key. You can get one at Semantix Gen AI Hub
Set an environment variable with your api secret:
$ export SEMANTIX_API_SECRET=<YOUR_API_SECRET>
$ semantix-ai --help
Configuring with semantix.yaml
Before using the ModelClient, you need to configure the library with a semantix.yaml file. This file should be placed in the same directory where your application is executed. The semantix.yaml file should contain the necessary API keys and other configuration options for the models you want to use.
Here's an example of a semantix.yaml file:
providers:
semantixHub:
serverId: "YOUR INFERENCE SERVER ID HERE"
version: "v0"
apiSecret: "YOUR SEMANTIX GEN AI HUB API TOKEN"
cohere:
apiKey: "YOUR COHERE API KEY"
generate:
model: "command"
version: "v1"
Replace the placeholders with your actual API keys and other configuration options.
Using ModelClient
The ModelClient class allows you to interact with different models. To create a model client, you need to specify the type of model you want to use. The available options are "alpaca", "llama2", and "cohere".
Here's an example of how to create a model client and generate text using the Alpaca model:
from semantix_genai_inference import ModelClient
# Create an Alpaca model client
client = ModelClient.create("alpaca")
# Generate text using the Alpaca model
prompt = "Once upon a time"
generated_text = client.generate(prompt)
print(generated_text)
You can replace "alpaca" with "llama2" or "cohere" to use the Llama2 or Cohere models, respectively.
DEV - Publish to pypi
$ poetry config pypi-token.pypi <YOUR_PYPI_TOKEN>
$ poetry build
$ poetry publish
DEV - Bump version
$ poetry version patch | minor | major | premajor | preminor | prepatch | prerelease
See more at Poetry version command docs
DEV - Commit message semantics
See at Conventional Commits
Metadata
Release files for semantix-genai-inference 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| semantix_genai_inference-0.0.11.tar.gz | 10.7 kB | Without provenance | Details for semantix_genai_inference-0.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| semantix_genai_inference-0.0.11-py3-none-any.whl | Python 3 | none | any | Details for semantix_genai_inference-0.0.11-py3-none-any.whl |
Total release size: 24.9 kB
Release files / semantix_genai_inference-0.0.11.tar.gz
| Download URL | semantix_genai_inference-0.0.11.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6234eea50f3983e89ea37301e3abf7502123a186b40359dd9f515584aa854cd
|
|
BLAKE2b-256 checksum How to use checksums |
841b625f0aca8e5b44229dc01fa20c028652e5dd45af98e27eb53709cb00e0b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.0 Darwin/21.6.0
|
Release files / semantix_genai_inference-0.0.11-py3-none-any.whl
| Download URL | semantix_genai_inference-0.0.11-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aa04b94541bd8ac9253952a4c2b0e3e67b68f8438a7c83d5432f992f89a5afab
|
|
BLAKE2b-256 checksum How to use checksums |
fe123c957f47c8e7e7ffa5bf8da7dc8ee952b0ef38abf1700f8dfcd6502c7cab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.2 CPython/3.10.0 Darwin/21.6.0
|
Security for semantix-genai-inference 0.0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.