Skip to main content

inferhive (SDK + CLI)

Python SDK and command line for InferHive, the collaborative GPU lending and LLM inference platform by Impulsate: rent or reserve GPUs, run batch jobs (with a queue when every GPU is busy), move files to and from the cloud, and call an OpenAI-compatible LLM gateway. Everything is paid in processing coins (PC), the platform's credits.

  • Commands: inferhive (and pcoin, kept as an alias).
  • Python import package: pcoin.
  • Requires Python 3.12+. The portal lives at https://inferhive.impulsate.lat.

Install

pip install inferhive            # SDK + CLI
pip install 'inferhive[openai]'  # plus the OpenAI client for the LLM gateway
pip install 'inferhive[worker]'  # plus llama-cpp-python, to lend your own device as a worker

Log in

inferhive login              # opens the portal in your browser; type the code shown here
inferhive balance

inferhive login asks the portal for an API key: you approve it in the browser with your usual portal session, typing the code the terminal prints. The key is stored in ~/.config/pcoin/platform_key (mode 0600) and used by the CLI and the SDK from then on. Revoke it any time from the portal (API keys). Scripts and CI can use a key you created in the portal instead, through the INFERHIVE_API_KEY environment variable.

Command line

inferhive offers                                   # GPUs and CPU you can rent right now
inferhive rent --gpu dp-note --template pytorch-jupyter --hours 1   # then open the URL it prints
inferhive instances | stop INS-XXXXXX              # your rentals
inferhive reserve --gpu knode11 --start 2026-11-10T18:00 --hours 2

inferhive job run python:3.12-slim -- python -c "print('hola')"            # CPU job
inferhive job run ghcr.io/you/whisper:1 --offer gpu --minutes 60 \
    --input meeting.mp3 --outputs ./results -- python -m pcoin.jobio -- python run.py
inferhive job list | logs JOB-XXXXXX | cancel JOB-XXXXXX

inferhive artifact put data.zip | list | get ART-XXXXXXXX | rm ART-XXXXXXXX
inferhive volume create dp-note 5 | list | delete VOL-XXXXXX
inferhive llm chat "Explain processing coins in one line"

GPU jobs sent with --offer gpu (any GPU) or with --wait on a busy node wait in a queue and start when a GPU frees up; nothing is charged while they wait. Inside the job container, python -m pcoin.jobio -- <your command> downloads the input files to /inputs, runs your program and uploads /outputs as a tarball when it ends.

Python

import pcoin

with pcoin.Client() as c:                      # uses the key saved by `inferhive login`
    print(c.balance())                         # {"currency": "PC", "available": ..., ...}

    free = [o for o in c.offers(gpu="4060") if o["available_now"]]
    inst = c.rent(free[0]["id"], "pytorch-jupyter", hours=1)
    c.stop(inst["id"])

    audio = c.upload_artifact("meeting.mp3")
    job = c.submit_job(
        "ghcr.io/you/whisper:1",
        offer="gpu",                           # or a node name
        timeout_minutes=60,
        inputs=[audio["id"]],
        outputs=True,
        command=["python", "-m", "pcoin.jobio", "--", "python", "run.py"],
    )
    done = c.wait_job(job["id"], on_update=lambda j: print(j["status"], j.get("queue_position")))
    c.download_artifact(done["result"]["output_artifact"], "results.tar.gz")

LLM gateway, with any OpenAI client (pip install 'inferhive[openai]'):

from pcoin import llm

client = llm.openai_client()                   # PCOIN_API_KEY or ~/.config/pcoin/api_key
reply = client.chat.completions.create(
    model="qwen3.8-27b",
    messages=[{"role": "user", "content": "Hola"}],
)
print(reply.choices[0].message.content)
print(llm.chat_full("Hola")["cost_pc"])        # the PC the gateway charged for that call

Environment variables

Variable Purpose
INFERHIVE_API_KEY Platform API key (pak_...) for /api/v1; overrides the saved one
PCOIN_API_KEY LLM gateway key (pck_...), created in the portal (LLM keys)
INFERHIVE_PORTAL_URL, INFERHIVE_LLM_URL Other portal or gateway (defaults: the public ones)
PCOIN_CONFIG_DIR Where keys are stored (default ~/.config/pcoin)

Errors

Every API error raises a pcoin.errors.PCoinError subclass with a stable code (AuthError, InsufficientCreditsError, NotFoundError, ValidationError, RateLimitError, ServerError). The CLI prints the message and exits with status 1.

Changes

  • 0.3.0: pcoin.jobio uses /inputs and /outputs when the portal mounts them and otherwise writable folders under /scratch, and retries connection errors; automatic retry of 429 following Retry-After; artifact get no longer overwrites local files (--force); job run --secret-env, --detach --outputs and job outputs; rent --minutes; llm keys save.
  • 0.2.0: browser login (pcoin login), GPU queue, cloud files and batch jobs.

License

MIT. Full documentation, pricing and the platform's architecture: https://hive.impulsate.lat.

Metadata

Release files for inferhive 0.3.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 inferhive 0.3.0
File Size Uploaded Provenance Actions
inferhive-0.3.0.tar.gz 35.3 kB With provenance Details for inferhive-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 74.7 kB

Release files / inferhive-0.3.0.tar.gz

Download URL inferhive-0.3.0.tar.gz
Size 35.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0b0229dd860c5f75f3f47269d2fe6029baec4013ad2d116bc8736bbfb77f06e7
BLAKE2b-256 checksum
How to use checksums
7ee95db0b63bade387a52b9d38803266c549dacdd6698c1269b6def65e2c4229
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / inferhive-0.3.0-py3-none-any.whl

Download URL inferhive-0.3.0-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6a427171559903db49c9cbb5ca4c6f97252913897155318a85eb70da31298c4
BLAKE2b-256 checksum
How to use checksums
4818a53cab8731b15c235e435df78739c4027dc271f20479230fca5498410ba5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for inferhive 0.3.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for inferhive-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

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