Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Foretoken command-line tool

English | 简体中文

The Foretoken command-line tool installs the shared Kubernetes platform, deploys model services from Kustomize configurations, reports serving readiness, resolves frontend endpoints, and runs benchmarks through one foretoken entry point.

For a new cluster, start by installing the command-line tool. If foretoken --version already works, go straight to platform installation. If the cluster already has the Foretoken platform, start with model deployment.

Before you start

You need Python 3.10 or later, an active Kubernetes context, kubectl, and Helm. GPU nodes must already have their vendor driver and Kubernetes device plugin. Source installation also requires Docker and Make, plus either a local kind/k3d cluster or an OCI registry reachable by every target node.

Install the command-line tool

Install the published Foretoken command-line tool package with pip:

pip install foretoken

# For source installation from the repository:
# pip install -e .

Or create and activate a virtual environment with uv:

uv venv
source .venv/bin/activate
uv pip install foretoken

This step only installs the foretoken command in the current Python environment; it does not change the Kubernetes cluster. Run foretoken --version to see the command-line tool and corresponding platform version.

Install the Kubernetes platform

foretoken install installs the Foretoken CRDs and controller in the active Kubernetes context. Platform resources use the foretoken-platform namespace. The command also configures monitoring and, in Gateway mode, the Gateway resources. Deploy model services separately with foretoken deploy.

Default installation

The default uses release images and local access through a LoadBalancer Service:

foretoken install

During installation, the command-line tool discovers Prometheus and accelerator metric exporters. It reuses compatible shared instances, installs managed Prometheus and NVIDIA DCGM Exporter releases when needed, and connects to the mxExporter already provided by a MetaX cluster. It never installs GPU drivers, device plugins, or vendor operators. Ambiguous or incomplete monitoring stops installation with an actionable error; see Observability for the selection rules.

Gateway mode

The command-line tool creates a dedicated GatewayClass and Gateway only when the cluster runs Envoy Gateway:

foretoken install --frontend-mode gateway

With another Gateway Controller, reuse a Gateway managed by that controller:

foretoken install \
  --frontend-mode gateway \
  --gateway-name inference-gateway \
  --gateway-namespace gateway-system

Add --gateway-section-name LISTENER only when more than one listener matches.

Current source

Build Foretoken images from the current source tree and configure the platform to use them:

foretoken install -e .

A standard active kind or k3d context imports the built images locally. Other Kubernetes contexts need a registry reachable by their nodes. Sign in to the registry host with an account that can push the target repository before installation:

docker login ghcr.io
foretoken install -e . --registry ghcr.io/example/foretoken

Registry login authorizes the local image push. Private registries also need imagePullSecrets and workload.imagePullSecrets through --values so nodes can pull the images; see Deploy Foretoken from Source.

Installation options

Repeatable --values files provide platform image, runtime, and hardware settings. Release and source installs record their mode in Helm metadata and cannot switch silently. Releases originally installed directly with Helm remain under their existing Helm lifecycle and are not adopted automatically.

Deploy and operate model services

Deploy one frontend and all models rendered by a Kustomize root:

foretoken deploy examples/multi-model-quickstart

The command applies the configuration, reports each FrontendService and ModelService state when it changes, and exits when every resource is Ready for its current generation. Change the default ten-minute deadline with --timeout.

Delete the resources rendered by the same configuration:

foretoken delete examples/multi-model-quickstart

The command waits for deletion and ignores resources that are already absent. After deleting all Foretoken services, remove the platform release:

foretoken uninstall

The command preserves Foretoken CRDs and refuses to uninstall while user-owned services remain. It removes monitoring and Gateway resources managed by the command-line tool with the platform, while reused cluster components remain unchanged.

Inspect the same deployment without applying it:

foretoken status examples/multi-model-quickstart

Inspect every Foretoken service in a namespace, or continue watching state changes:

foretoken status -n foretoken-multi-model-demo
foretoken status -n foretoken-multi-model-demo --watch

Resolve the public frontend URL after deployment:

FORETOKEN_FRONTEND_URL="$(foretoken endpoint examples/multi-model-quickstart)"

For an HTTP Gateway, resolve its request Host separately:

FORETOKEN_FRONTEND_URL="$(foretoken endpoint examples/quickstart)"
FORETOKEN_REQUEST_HOST="$(foretoken endpoint examples/quickstart --host)"

The host value is the URL authority for direct access or the configured routing hostname for an HTTP Gateway. The command waits for the LoadBalancer or Gateway address, but serving readiness remains owned by foretoken deploy.

Run benchmarks

Install the optional benchmark dependencies with pip:

pip install 'foretoken[bench]'

# For source installation from the repository:
# pip install -e .
# pip install -e '.[bench]'

Or install the benchmark dependencies in the activated uv environment:

uv pip install 'foretoken[bench]'

Then run the benchmark:

foretoken bench examples/quickstart

The command-line tool uses the active kubectl context and honors standard Kubernetes configuration such as KUBECONFIG.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foretoken-0.0.1a1.tar.gz (81.1 kB view details)

Uploaded Source

Built Distribution

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

foretoken-0.0.1a1-py3-none-any.whl (100.1 kB view details)

Uploaded Python 3

File details

Details for the file foretoken-0.0.1a1.tar.gz.

File metadata

  • Download URL: foretoken-0.0.1a1.tar.gz
  • Upload date:
  • Size: 81.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for foretoken-0.0.1a1.tar.gz
Algorithm Hash digest
SHA256 923f6289c03eac9ba307397d580ab9410f07102a58ca7d879e4aa343df040bf4
MD5 45104e2fbc35dec672d4cc82ce3d5091
BLAKE2b-256 6e0cb9c5ca84712488afaaf3ae43a6a33c25467844784b2891c95003ffccb452

See more details on using hashes here.

Provenance

The following attestation bundles were made for foretoken-0.0.1a1.tar.gz:

Publisher: publish-python-package.yaml on shiweijiezero/foretoken

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file foretoken-0.0.1a1-py3-none-any.whl.

File metadata

  • Download URL: foretoken-0.0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 100.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for foretoken-0.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 eaa0a2cb27bc45f18cbf56119d272b6829b462d97622bae4509d3f1cc8c8ae87
MD5 1489ecb3663c267947fecbc6c5bfebd1
BLAKE2b-256 9fc65b28ce6480d478da235d2d432b446ed69b6a68f18f7147c1fe72673b322d

See more details on using hashes here.

Provenance

The following attestation bundles were made for foretoken-0.0.1a1-py3-none-any.whl:

Publisher: publish-python-package.yaml on shiweijiezero/foretoken

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.1a1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page