Skip to main content

privatemind

Official Python SDK for the PrivateMind ML platform. Submit distributed training jobs to managed Ray + KubeRay + MLflow GPU clusters from any Python environment, run a one-off command as a workspace job, and promote a notebook function to the fleet without leaving Python.

pip install privatemind

In a PrivateMind notebook the SDK is pre-installed and pre-configured, so the quickstart below runs with nothing to set up.

Full documentation: docs.privatemind.com/sdk.html

Quickstart

from privatemind import submit_training

run = submit_training(
    entrypoint="python train.py --epochs 10",
    image="registry.example.com/trainer@sha256:...",
    workers=4,
    target_cluster="<your-gpu-cluster>",
    gpus_per_worker=1,
)

print(run)            # Run(name='tj-abc12', phase='Pending')
print(run.url)        # link to the platform UI

run.wait()            # block until the job stops running
print(run.phase, run.mlflow_run_id)

Zero-config inside a notebook

A PrivateMind workspace injects everything the SDK needs as environment, so inside a notebook you do not pass a token, URL, cluster, or image:

Variable What it provides
PRIVATEMIND_TOKEN per-workspace bearer token
PRIVATEMIND_URL gateway API base URL (batch, image generation)
PRIVATEMIND_APP_URL app backend base URL (training jobs)
PRIVATEMIND_TARGET_CLUSTER the GPU cluster the workspace runs on
PRIVATEMIND_TRAINING_IMAGE default worker image (falls back to the platform's list when unset)
PRIVATEMIND_HOME_VOLUME / PRIVATEMIND_HOME_PATH the home Volume used to stage promoted code

Off-cluster (laptop, CI) you supply a token (see Configuration); the URLs default to the production platform, and everything else is an explicit argument.

GPU jobs

Set gpus_per_worker and the platform pins real GPUs for you. You do not have to know which physical GPUs your org owns: when you omit gpu_placements, the platform auto-derives a placement from the GPUs your org owns that are free right now.

run = submit_training(
    entrypoint="python train.py",
    image="...",
    workers=1,
    target_cluster="<your-gpu-cluster>",
    gpus_per_worker=1,        # placement auto-derived
)

To pin exact GPUs, pass gpu_placements (one placement per GPU worker, each with exactly gpus_per_worker indices):

gpu_placements=[{"host": "<gpu-host>", "indices": [0]}]

For multi-node, set workers greater than 1: each worker gets gpus_per_worker GPUs. Omit gpu_placements and the platform places the workers for you; explicit placements support single-worker jobs. The platform is the authority on ownership, conflicts, and quota, and rejects a job that asks for GPUs it cannot have.

Promote a notebook function

@pm.train turns a function you just validated in the notebook into a distributed TrainingJob. Calling it runs locally (validate in seconds); .promote() ships it to the fleet.

import privatemind as pm

@pm.train(workers=1, gpus_per_worker=1)
def train(lr=3e-4, epochs=10):
    import torch, mlflow                  # imported on the worker
    assert torch.cuda.is_available()
    ...                                    # your training loop

train(lr=1e-3)                            # runs locally in the notebook
run = train.promote(lr=1e-3)              # runs on the fleet -> Run
run.wait()
print(run.phase, run.mlflow_run_id)

Inside a notebook you usually pass only workers + gpus_per_worker; target_cluster, image, and the home Volume come from the notebook context. .with_options(...) returns a copy with overrides (e.g. a different image) without re-decorating.

Every promote is tracked in MLflow with no setup: the run is named after the job (not a random name), CPU/GPU/memory system metrics are captured automatically, and anything you log inside the function — metrics, artifacts, mlflow.pytorch.log_model(...) — lands on that run. Pass experiment="..." to group runs under a named experiment.

Three rules make a function promotable:

  1. Take all inputs as arguments. The function and its bound arguments are cloudpickled; closing over a notebook global (a DataFrame, a loaded model) either bloats the payload or fails to pickle. Pass data via a mounted Volume, not a closure.
  2. Import inside the function. Imports re-resolve on the worker, so import only what the worker image provides.
  3. For GPU work, the body runs on a GPU worker. A GPU promote dispatches your function onto the GPU worker automatically, so plain torch code that uses CUDA works. For multi-GPU or distributed training, use Ray Train or ray.remote inside the function as you would in any Ray program.

The Run handle

run.refresh()              # re-fetch status
run.wait(timeout=3600)     # block until the job stops running, then return self
run.cancel()               # delete the job (idempotent)

run.phase                  # "Running", "Succeeded", ... (the six below)
run.mlflow_run_id          # MLflow run id once tracking starts
run.ray_job_name           # underlying RayJob name
run.start_time, run.end_time

run.phase is one of six values, in the two sets wait() keys on. Both are importable from privatemind:

Set Phases What it means
ACTIVE_PHASES Pending, Queued, Running the job is on its way through the platform; wait() polls while the phase is in here
TERMINAL_PHASES Succeeded, Failed, Terminating the job is done or being deleted; wait() returns

A phase in neither set raises UnknownPhaseError (carrying .run_name and .phase). It means the platform has grown a phase this SDK release cannot place, so the SDK stops rather than report a job as finished when it cannot tell: upgrade privatemind, or read run.phase and decide for yourself. wait(on_unknown_phase="return") and watch(on_unknown_phase="return") downgrade it to a UserWarning and return, which is worth asking for only deliberately. A notebook that opens with warnings.filterwarnings("ignore") turns the lenient path into a silent early return, and metrics(), params() and list_artifacts() will go on serving half a run's numbers.

wait() can narrate phase transitions as they happen. progress=True prints one timestamped line per transition plus a final line with the total elapsed time; on_change is a callback invoked with the new phase string on every transition (including the terminal one):

run.wait(progress=True)
# [12:00:01] run tj-abc12: Pending
# [12:00:06] run tj-abc12: Pending -> Running
# [12:11:43] run tj-abc12: Running -> Succeeded
# [12:11:43] run tj-abc12: Succeeded after 702.0s (terminal)

run.wait(on_change=lambda phase: print("now:", phase))

In a Jupyter notebook, run.watch() renders a live HTML status table that updates in place on every phase transition, then stops at the terminal phase. When no live Jupyter display is available (IPython missing, or no shell running) it degrades to wait(progress=True). And a run — or the whole result of list_jobs() — renders as an HTML table in Jupyter on its own, with no waiting involved:

run.watch()                # live-updating display; returns the run when done
from privatemind import list_jobs, get_job

for r in list_jobs():
    print(r.kind, r.name, r.phase)   # "training" or "job"

list_jobs(phase="Running")  # case-insensitive client-side phase filter

r = get_job("tj-abc12")

list_jobs() returns a RunList of everything you can see, training runs and workspace jobs alike: a training row comes back as a Run, a workspace row as a Job, and kind on either tells them apart. Slicing the list, or adding two together, gives another RunList and keeps the table rendering; sorted() and the other builtins that copy a list hand back a plain list, which does not. For training runs alone, list_training_jobs() reads the training endpoint directly, which is also where list_jobs() falls back on a platform too old to have workspace jobs at all. A row this release cannot place, a kind it has never heard of, stops the listing rather than being handed back as the wrong handle.

Workspace jobs

A workspace job runs one command in a workspace image on a home Volume, with no notebook in front of it, and ends when the command does. It is the way to run something long without keeping a browser tab open, and the way a schedule runs your code later.

from privatemind import submit_job

job = submit_job("python prepare.py --shard 3", template="python-slim-cpu")
job.wait()

print(job.phase, job.exit_code)   # "Succeeded" 0
print(job.logs())                 # the tail the platform kept

Inside a notebook the home Volume and the cluster come from the workspace's own environment, so command and template are all you pass. Elsewhere, name the Volume:

job = submit_job(
    "python train.py",
    template="pytorch-ngc",
    home_volume="my-home",
    extra_volumes=["datasets"],
    gpus=1,                       # placement auto-derived, as in training
    cpu="4",                      # or 2.5, a fraction of a core
    memory="32Gi",
    max_duration="6h",            # or timedelta(hours=6)
    shared=True,                  # visible to the org, like a shared workspace
)

The command runs under bash -c in the home directory with the container's environment; a cd, an export or a source belongs in the command, as it would in a script. Its whole output is written to ~/.privatemind/jobs/<name>/stdout.log in the home Volume, and job.logs() returns the tail of it the platform holds. A job with a short ttl_seconds_after_finished can have its record swept the moment it ends, so logs() falls back to the tail the last read already carried rather than raising over the record that is gone.

A job with gpus holds real cards for its whole run, the way a workspace does. There is no queue: if no card your org owns is free, the submit is refused rather than parked. max_duration is the platform's deadline, at most seven days, after which the job is ended and reports DeadlineExceeded.

job.refresh()                     # re-read the record
job.wait(timeout=3600)            # same knobs as Run.wait
job.delete()                      # end it and remove the record

The record reads back as properties: phase, reason, message, exit_code, start_time, end_time, created_at, template, template_version, command, home_volume, extra_volumes, target_cluster, gpus, gpu_host, gpu_indices, cpu, memory, net_profile, max_duration, ttl_seconds_after_finished, owner_user_id, visibility and deleting. Phases are the ones Run uses, minus Queued: Pending, Running, then Succeeded, Failed or Terminating.

get_workspace_job("job-ab12cd") fetches one by name. Workspace jobs follow the workspace visibility rule: you see your own, the shared ones, and the ones granted to you, so list_jobs() shows you those and nothing else. Reading a job outside that set raises ForbiddenError, and a name that exists nowhere raises NotFoundError; deleting a job that is not yours raises ForbiddenError even when you could read it, because a shared job is still its owner's to end.

Model servers

Launch an OpenAI-compatible vLLM server on your org's GPUs from a script. These calls need a personal API key: an org application key is refused.

import privatemind as pm

server = pm.launch_model_server(
    "gpu-cluster",
    gpus=8,
    volume="models",                 # or model="<slug>" from the catalog
    volume_subpath="my-model",
    vllm_version="v0.32.0",
    cpu="64",
    memory="512Gi",
    args={"tensor-parallel-size": "8"},
)
server.wait()                        # a large server can take most of an hour
server.register(["my-model"])        # now callable through the API

Free GPUs are picked for you unless you pass gpu_host and gpu_indices. pm.model_server_catalog() lists the models and vLLM versions you can launch, pm.model_server_allocations() your hosts and cards, and pm.list_model_servers() and pm.get_model_server(name) what is running. server.unregister() takes a server off the API and server.delete() stops it.

Reading MLflow results

Once a run has an mlflow_run_id (check run.mlflow_run_id), read its logged metrics, params, and artifacts back through the same Run handle. This is a read-only path: it never writes to the tracker, so it's safe to call from anywhere.

run = get_job("tj-abc12")

run.metrics()                # {"loss": 0.42, "acc": 0.91}  (latest values)
run.params()                 # {"lr": "0.001", "epochs": "3"} (values are str)
run.list_artifacts()         # [RunArtifact(path=..., is_dir=..., size=...)]

The tracking URI resolves in order: the tracking_uri= keyword argument, then the PRIVATEMIND_MLFLOW_URI environment variable, then a ConfigError. Pass it explicitly when you're off-platform:

run.metrics(tracking_uri="https://mlflow.internal")
run.list_artifacts(path="model")  # root the listing at a subpath

The read path needs the optional mlflow extra:

pip install 'privatemind[mlflow]'

For ad-hoc reads against any tracking server, build a client directly:

import privatemind as pm

client = pm.mlflow_client(tracking_uri="https://mlflow.internal")
mrun = client.get_run("abc123")
print(mrun.data.metrics)

Error mapping: a missing mlflow_run_id raises PrivatemindError (the job is still pending, or was submitted with mlflow=False); a run the tracker can't find raises NotFoundError; other tracker failures raise PrivatemindError.

The SDK deliberately does not auto-log your bound function arguments to MLflow. Bound args can carry secrets, and default-on logging to an org-readable tracker would invert that protection. Auto-logging will land later as an explicit, opt-in step.

Fine-tuning

One-call LoRA/QLoRA SFT: pm.finetune(...) validates the config and dataset client-side, stages a bundled TRL/PEFT recipe onto the home Volume, and submits it as a normal TrainingJob. The adapter lands on your Volume at output_path. Paths under your home Volume are translated to their job-side /workspace/… location automatically; datasets and weights mounted on other Volumes must be referenced exactly as the job will see them (pass validate_data=False if they aren't readable from the notebook).

import privatemind as pm

run = pm.finetune(
    model="Qwen/Qwen3-8B-Instruct",        # HF id or Volume path
    dataset="sft_data.jsonl",              # readable locally for the pre-flight check
    output_path="/workspace/adapters/support-v1",
    method="qlora",                        # 4-bit nf4 base loading
    experiment="support-bot",
)

run.wait()
print(run.phase, run.mlflow_run_id)
print(run.metrics())                       # trainer metrics, e.g. {"loss": 0.42}
print(run.params())                        # the resolved config fields

pm.finetune_dry_run(...) takes the same keyword arguments, runs the same validation, and prints the resolved configuration summary without submitting anything — use it as the pre-flight check:

pm.finetune_dry_run(
    model="Qwen/Qwen3-8B-Instruct",
    dataset="sft_data.jsonl",
    output_path="/workspace/adapters/support-v1",
    method="qlora",
)
  • Dataset formats: chat_jsonl (one {"messages": [{"role": ..., "content": ...}, ...]} conversation per line) and text (one {"text": ...} row per line) — auto-detected from the first row unless you pass dataset_format=; pm.dataset_formats() lists the registry. The first 50 rows are validated before submit, so a mis-shaped file raises before any GPU time is spent (sniff_rows= to change it); pass validate_data=False to skip, e.g. when the dataset is only readable on the cluster.
  • Single-node in this release: workers must be 1; use gpus_per_worker for multi-GPU.
  • The training image carries the dependencies: trl, peft, transformers, accelerate and datasets must be in the image; QLoRA also needs bitsandbytes, and packing (default on) needs flash-attn (or the kernels package). The recipe fails fast with a version report when something is missing, before GPU memory is allocated.
  • Output: output_path receives the adapter (adapter_config.json + adapter_model.safetensors) and the tokenizer files, also logged as an MLflow artifact when mlflow=True.

Image generation

Generate images straight from Python. A prompt goes in, base64 images come back through the same gateway choke point as training (auth, audit, billing, rate-limiting).

from privatemind import generate_image

resp = generate_image(
    model="cosmos3-super-text2image",
    prompt="a tropical beach at sunset, dramatic clouds",
    size="1024x1024",
    n=4,
)

for i, img in enumerate(resp.data):
    # b64_json is a base64-encoded PNG; the SDK does not decode it for you.
    import base64
    with open(f"out_{i}.png", "wb") as f:
        f.write(base64.b64decode(img.b64_json))

print(resp.warnings)  # non-fatal notices, e.g. off-allowlist size

size is required and must be WIDTHxHEIGHT (e.g. 1024x1024). It is a required argument, so omitting it is a TypeError, and a malformed size raises ValidationError before the request leaves.

Inference knobs are forwarded verbatim; extra_args is a blind passthrough:

resp = generate_image(
    model="cosmos3-super-text2image",
    prompt="...",
    size="1024x1024",
    num_inference_steps=50,
    guidance_scale=4.0,
    flow_shift=3.0,
    negative_prompt="blurry, low quality",
    seed=1143,
    extra_args={"new_backend_param": "value"},
)

generate_image() returns a typed ImageGenerationResponse: created, data (each item exposing b64_json and revised_prompt), and warnings. The SDK returns base64 strings and leaves decoding to you.

Prompt enrichment (upsampling)

The chat UI enriches sparse prompts into dense, structured text-to-image JSON before generation. The SDK does not bundle that step — it would couple the client to a specific LLM and a schema that evolves on the backend. Wire it in yourself with any model you like:

# 1. Ask any strong LLM to expand your description into structured T2I JSON,
#    using a text-to-image template you control.
enriched_json = my_llm.complete(t2i_template.format(description="a cat"))

# 2. Pass that JSON string straight through as the prompt.
resp = generate_image(
    model="cosmos3-super-text2image", prompt=enriched_json, size="1024x1024"
)

Batch jobs

Run bulk chat-completion work asynchronously: upload a JSONL file of requests, create a batch from it, wait, and iterate the results. The flow mirrors the OpenAI batch workflow, so an author who knows that API can carry their mental model over — same parameters, same object fields, flat methods in the SDK's own style.

from privatemind import Client

# Batch + image generation run against the gateway (PRIVATEMIND_URL).
# Training runs and workspace jobs run against the app backend
# (PRIVATEMIND_APP_URL); set it only if you also call submit_training /
# submit_job / list_jobs / get_job.
client = Client()  # token + base_url from env, zero-config in notebooks

f = client.create_file(file=open("in.jsonl", "rb"), purpose="batch")
batch = client.create_batch(
    input_file_id=f.id,
    endpoint="/v1/chat/completions",
    completion_window="24h",
)
batch.wait()                       # poll until terminal; pass timeout= to bound it
for line in batch.results():       # one raw dict per JSONL output line
    print(line["custom_id"], line["response"]["status_code"])

The six calls, one-to-one with the gateway's batch endpoints: create_file(file=, purpose="batch"), get_file_content(file_id), create_batch(input_file_id=, endpoint=, completion_window=, metadata=), get_batch(batch_id), list_batches(limit=, after=), cancel_batch(batch_id). Each also exists as a module-level function (from privatemind import create_batch) sharing the lazy process-wide client.

Batch.wait() polls while the status is in ACTIVE_BATCH_STATUSES (validating, in_progress, finalizing, cancelling) and stops on TERMINAL_BATCH_STATUSES (completed, failed, expired, cancelled), refreshing the object in place and returning it. timeout=None waits forever; the poll interval doubles, capped at 30s or the initial interval, whichever is larger. A status in neither set means the SDK is older than the platform, and raises UnknownStatusError rather than reporting a batch that may still be running as finished; pass on_unknown_status="return" to warn and return instead. Batch.results() downloads the output file and yields each parsed JSON object (custom_id, response, error); Batch.error_results() does the same for the error file — the per-request failures. Before the batch is terminal both raise and tell you to wait(); on a terminal batch whose requests all failed there is no output file, so results() raises and points you at error_results().

list_batches returns one page as a plain list. Advance with after=batches[-1].id until a page comes back empty; the gateway caps limit server-side, so don't rely on len(batches) == limit to detect more pages. The gateway has no status filter — filter client-side: [b for b in client.list_batches() if b.status == "in_progress"].

Server-side limits (request count, file size, rate) are enforced by the gateway, not the SDK, so they can change without an SDK upgrade; a rejected request surfaces as a normal SDK exception. max_tokens is defaulted server-side; set it per request line if you need a different value.

Data retention: batch input and output files are content-bearing and retained server-side for up to 29 days. The batch feature is not eligible for zero-data-retention (ZDR) arrangements.

Secrets

A secret attached to a workspace or job in PrivateMind is mounted as one file per secret under /var/run/privatemind-secrets. Read it by name:

import privatemind as pm
import psycopg

conn = psycopg.connect(password=pm.secret("WAREHOUSE_PASSWORD"))
key = pm.secret_bytes("SIGNING_KEY")      # exact bytes, for what is not text

for s in pm.attached_secrets():           # names, never values
    print(s.name, s.owner_type, s.owner, s.env)

secret() reads the file on every call and caches nothing, so a value replaced in PrivateMind is what the next call returns, with no restart. Where that directory does not exist, on a laptop or in CI, it reads the environment variable of the same name instead, so the same code runs against a local .env (load it with your shell or python-dotenv; the SDK does not read it). Where the directory exists, the file is the only source, and a name with no file raises SecretNotFoundError saying the secret is not attached and where to attach it.

Every attached secret is a file. It is also an environment variable of the same name only when its attachment turns on env export, which is off by default, so read it with secret() rather than os.environ: that works either way. attached_secrets() lists what is attached, and env on each entry says whether it is exported.

Names are A-Z, 0-9 and _, start with a letter and are at most 64 characters; anything else raises ValidationError before any file is touched. No error carries a value. In a notebook, pass the value straight to the code that needs it: a cell whose last expression is the value prints it into the notebook file.

Market data

Feeds added to a workspace under its Settings, Market data, in PrivateMind are read over S3 with DuckDB, with nothing to set up:

import privatemind as pm

pm.feeds()                                   # the feeds added to this workspace, as a table
xetra = pm.feed("xetra")                     # by its name in PrivateMind, its dataset id, or part of either

xetra.files("2026-10-20", "2026-10-24", slot="tick")   # a table of date, time, tier, site, slot, size and name
xetra.read("2026-10-20", slot="tick", site="fr2-l1").limit(5).show()   # text: one line per row

cta = pm.feed("cta")
cta.schema("tick").show()                    # its columns, from one file's footer
cta.files("2026-06-26 13:00", "2026-06-26 15:00", slot="tick")         # the 13:00 and 14:00 files
df = cta.read("2026-06-26 13:00", "2026-06-26 14:00", slot="tick", columns=["SystemTimestamp", "Symbol", "Bid"]).df()

pm.market_data.status()                      # whether market data can be read here, and if not, why

In a notebook pm.feeds(), feed.files() and pm.market_data.status() show as tables, and print() gives the same as text. The files table ends with the count and total size, and past 60 files it shows the first and last 20. The result is still a plain list of FeedFile, each with its path, date, tier, site, slot, size, and start and end (the times in its name).

pm.feed() also takes part of a feed's name or dataset id, as long as only one feed has it. When nothing matches, the error names the closest feed if one is close.

files() walks the feed's folders for you, one listing per day, so nobody needs to know the layout. start and end are days, both included, or times such as "2026-06-26 13:00" or a datetime. A time range picks the files whose times overlap it, with end excluded. File names give their times in UTC, a datetime with a zone is moved to UTC, and one without a zone is taken as UTC. A file whose name has no time is listed only for whole days. end defaults to the end of start's day. With no dates files() lists the most recent day of each tier that has files matching the filters, looking back up to 31 days.

read() returns a DuckDB relation over the same files, with each row's date, tier and site. Times pick whole files, so filter on the feed's own timestamp column for anything finer. Nothing is fetched until the relation is used, and then only the columns and row groups the query needs: .df() gives pandas, .pl() polars, and .filter(), .aggregate() and .order() work before anything is fetched. A parquet tick file can be several GB with hundreds of columns, so once the files hold more than 1 GiB read() asks for columns, and columns="*" reads every one. Text feeds come back one line per row, with line endings removed and a blank line as NULL. Files of more than one slot are refused; pass slot.

For SQL of your own, pm.market_data.sql(query) runs DuckDB on a connection that already holds the workspace's key, with feed.path as the s3:// prefix, and pm.market_data.connect() returns such a connection for longer work, one per thread. configure(con) gives the key to a DuckDB connection you opened yourself. pm.market_data.status() says whether market data can be read here and, if not, why: mount, feeds, key expiry, DuckDB and its S3 extension, memory, and one listing to check the key is accepted. Its ready is True when nothing would stop a query.

The feeds are not on disk. PrivateMind mounts the workspace's own S3 key and the list of feeds under /var/run/privatemind-market-data, and every call re-reads those files, so a feed added in PrivateMind or a key replaced every few weeks works with no restart and nothing to re-run, including on a Feed kept in a notebook. Every connection from connect() and sql() shares one in-memory database, so a connection opened earlier picks up a replaced key as soon as any of them is called again.

The key goes into a temporary DuckDB secret scoped to the workspace's bucket, so other S3 secrets on the connection keep working for other buckets. It is passed as a bound parameter, so it appears in no SQL text or query log, and nothing is written to disk. Outside a workspace, in a workspace with no feeds added, or in one started before market data was set up for it, feeds() returns an empty list and the other calls raise MarketDataError saying which. Workspace jobs do not get market data. DuckDB comes with the market-data extra (pip install 'privatemind[market-data]'); workspace images ship it with its S3 extension, which workspaces cannot download, so a DuckDB you install yourself needs that extension built for its version.

In a container with a memory limit, the connections sql() and connect() hand out get a quarter of it and spill to /tmp/privatemind-duckdb (at most 16 GiB), so a large scan slows down instead of taking the workspace's Jupyter and terminals down with it.

DuckDB also holds every parquet file's footer in memory while it reads, outside that limit, and large tick files have large footers: a 7 GB file's takes about 800 MB to open. Before reading, read() and schema() check that the files' footers fit in the memory the workspace has left, and refuse with the numbers when they do not, so the workspace is not killed. Read such files an hour or a file at a time:

cta.read("2026-06-26 14:00", "2026-06-26 15:00", slot="tick", columns=["Symbol", "Bid"]).df()

for f in cta.files("2026-06-26", slot="tick"):
    part = cta.read(files=[f], columns=["Symbol", "Bid"]).filter("Symbol LIKE 'IBM%'").df()

Configuration

The client resolves auth from, in order:

  1. token=... kwarg on Client(...)
  2. PRIVATEMIND_TOKEN environment variable
  3. ~/.privatemind/auth file (must be mode 0600, owned by you, not a symlink)

The base URL comes from base_url=... or PRIVATEMIND_URL and defaults to https://api.privatemind.com, the production platform API, which serves batch and image generation. It must be https:// unless you set allow_insecure_http=True (or PRIVATEMIND_ALLOW_INSECURE_HTTP=1).

Training runs and workspace jobs (submit_training, submit_job, list_jobs, get_job, get_workspace_job) run against the app backend, configured via app_url=... or PRIVATEMIND_APP_URL and defaulting to https://privatemind.com (same https:// rule).

Power use: explicit Client

from privatemind import Client

with Client(token="...") as pm:  # URLs default to the production platform
    for run in pm.list_jobs():
        print(run.name, run.phase)

The module-level functions share one lazily-created Client; reconfigure(...) swaps it (useful in notebooks when credentials change).

Errors

All raise subclasses of PrivatemindError: AuthError, ConfigError, ValidationError, ForbiddenError, NotFoundError, ConflictError, RateLimitError, ServerError, SecretNotFoundError, MarketDataError, UnknownPhaseError, UnknownStatusError. The last two share an UnknownStateError base, so one except covers a run and a batch. Client-side validation fails fast before any request.

License

Apache 2.0.

Metadata

Release files for privatemind 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for privatemind 0.8.0
File Size Uploaded Provenance Actions
privatemind-0.8.0.tar.gz 186.2 kB Without provenance Details for privatemind-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for privatemind 0.8.0
File Interpreter ABI Platform Actions
privatemind-0.8.0-py3-none-any.whl Python 3 none any Details for privatemind-0.8.0-py3-none-any.whl

Total release size: 309.0 kB

Release files / privatemind-0.8.0.tar.gz

Download URL privatemind-0.8.0.tar.gz
Size 186.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1901a7e53a0f828d25fdce7443d57622125948562e077133c2698b5c8470df94
BLAKE2b-256 checksum
How to use checksums
483c2b3ae2e1424efc037cfccd2e063a3deea94668da1ad7416df806295e1e8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / privatemind-0.8.0-py3-none-any.whl

Download URL privatemind-0.8.0-py3-none-any.whl
Size 122.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f04c2d8d34ff74b29d9ab87293858e8b9f33a08423b7aabcd90289cf1c54026
BLAKE2b-256 checksum
How to use checksums
c7ce0b0e6b9a0524c78d0768d1353cacf44a656ef461e3c5aa265638778c510a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for privatemind 0.8.0

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.

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