SDK for the Vals AI Platform
Project description
Vals AI CLI and SDK Tool
Install
pip install valsai
Overview
This Python package contains two items - a CLI tool to use Vals from the command line, and an SDK to use Vals from Python code.
All code is contained within vals/, separated by CLI and SDK. Note that many of the CLI functions
are just thin wrappers around the SDK.
Examples
We've provided a set of examples in examples/. They are organized as follows:
suites/- These are example JSON files, of the sort that you may use forvals suite create <example.json>.scripts/- These are example Python scripts that leverage the sdk.
Authentication
Make an account at platform.vals.ai and confirm your email.
Then, go to platform.vals.ai/project/default-project/settings/api-keys and create an API key. If using a different project, navigate to that project's settings instead.
If you are using the command line, you should set the following:
export VALS_API_KEY=<YOUR API KEY>
If you're using the EU instance of vals, you should also set export VALS_REGION=europe. Include these in your .zshrc / .bashrc to make them permanent.
See the documentation for passing in your API key directly via Python code for SDK usage.
CLI Usage
The CLI is run as follows:
$ vals
Use the --help flag at the top and subcommand level for guidance.
Commands must be run from the pip environment the cli was installed in. Commands are split up into subcommands. Currently there are three main subcommands:
vals suite --help: relating to creating / updating tests and suitesvals run --help: relating to creating and querying runs and run resultsvals project --help: relating to listing and managing projects
Full documentation of the CLI usage can be found in our documentation at docs.vals.ai/cli/cli
SDK Usage
All of the functionality that is in the CLI can also be accessed via Python functions, as well as features only available in the SDK.
See usage documentation in our docs: docs.vals.ai/sdk
Development
Local installation
The sdk uses uv for dependency management. A Makefile is provided to help with development.
To install dependencies, run:
make install
Run the following command to install it locally. The -e flag is optional, but recommended, as it allows you to make changes to the code without reinstalling. The dev flag is required for dev-only depedencies.
pip install -e ".[dev]"
If using the sdk in a project, to install the sdk in editable mode (apply local sdk changes without reinstalling), in your project directory run:
uv pip install -e /path/to/vals-sdk
or
pip install -e /path/to/vals-sdk
Additional Makefile commmands
make install Install dependencies for development
make test Run tests
make style Lint & Format
make typecheck Typecheck
make codegen Generate GraphQL client
Running Codegen
Add additional .graphql files to vals/graphql, then run the following command:
make codegen
or
ariadne-codegen --config codegen-config.toml
NOTE: This will overwrite anything in the vals/graphql_client directory.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file valsai-0.3.8.tar.gz.
File metadata
- Download URL: valsai-0.3.8.tar.gz
- Upload date:
- Size: 328.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3f569e7f5e4c01512aece31bfe40658dd5a984a918d70d43ae322c24cd4ae7e
|
|
| MD5 |
2c8ac6fe0a7427f6c49d4d0f91673745
|
|
| BLAKE2b-256 |
ea094ccee519c4120d372c989bc2a60baadffcc86353584e1ca5c815887fa1d5
|
Provenance
The following attestation bundles were made for valsai-0.3.8.tar.gz:
Publisher:
sdk-publish.yml on vals-ai/platform
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
valsai-0.3.8.tar.gz -
Subject digest:
c3f569e7f5e4c01512aece31bfe40658dd5a984a918d70d43ae322c24cd4ae7e - Sigstore transparency entry: 743780804
- Sigstore integration time:
-
Permalink:
vals-ai/platform@245d6e328d97809a774547f8ba652fd48380a6f7 -
Branch / Tag:
refs/tags/sdk-v0.3.8 - Owner: https://github.com/vals-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-publish.yml@245d6e328d97809a774547f8ba652fd48380a6f7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file valsai-0.3.8-py3-none-any.whl.
File metadata
- Download URL: valsai-0.3.8-py3-none-any.whl
- Upload date:
- Size: 103.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e8b3d942ea21d4f179330949ef445da5c1ed1b21915e79be989cbb1607c1f8a
|
|
| MD5 |
e95306157220056ffd92cf949682874e
|
|
| BLAKE2b-256 |
168190edbd037794c8dbb873acda780985f8cdebde52fe1d66efef1f95cf092f
|
Provenance
The following attestation bundles were made for valsai-0.3.8-py3-none-any.whl:
Publisher:
sdk-publish.yml on vals-ai/platform
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
valsai-0.3.8-py3-none-any.whl -
Subject digest:
2e8b3d942ea21d4f179330949ef445da5c1ed1b21915e79be989cbb1607c1f8a - Sigstore transparency entry: 743780807
- Sigstore integration time:
-
Permalink:
vals-ai/platform@245d6e328d97809a774547f8ba652fd48380a6f7 -
Branch / Tag:
refs/tags/sdk-v0.3.8 - Owner: https://github.com/vals-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-publish.yml@245d6e328d97809a774547f8ba652fd48380a6f7 -
Trigger Event:
push
-
Statement type: