chalk-ai/chalk-ai-plugins

deploy-chalk-function

How to deploy a chalk function ("chalkcompute.function").

Quelltext ansehen

Verwendung

  1. Installationsbefehl kopieren und das Quellpaket vor der Installation in der eigenen Agentenumgebung prüfen.
  2. Benötigte Werkzeuge, Zugangsdaten und Hosts im Original prüfen.
  3. Eingabe und gewünschtes Ergebnis beschreiben und die Ausgabe mit den Quellen abgleichen.
npx skills add https://github.com/chalk-ai/chalk-ai-plugins --skill deploy-chalk-function

Vor dem Start

  • Die Installation umfasst weder Modellabo noch API-Kontingent oder Dateizugriffsrechte.
  • Sterne und Installationen zeigen Aktivität, keine unabhängige Qualitäts- oder Sicherheitsprüfung.
Originales Skill-Dokument

Aus dem Quell-Repository gerendert; Überschriften, Beispiele, Code, Tabellen, Links und Bilder bleiben erhalten.

Deploy a Chalk function

Make a python file that uses the chalkcompute package (PyPI name is chalkcompute, not chalk-sandbox-sdk). Use a uv shebang. Pin Python to <3.14 because a transitive Rust dep (chalk-remote-call-python) builds against PyO3 which currently maxes out at 3.13.

py
#!/usr/bin/env -S uv run --script
#
# /// script
# requires-python = ">=3.12,<3.14"
# dependencies = ["chalkcompute"]
# ///

import chalkcompute


@chalkcompute.function()
def some_function(arg_1: str) -> str:
    return f"hi {arg_1}"


if __name__ == "__main__":
    print(some_function("world"))

Notes:

  • @chalkcompute.function must be called — @chalkcompute.function() (keyword-only args). Bare @chalkcompute.function raises TypeError: function() takes 0 positional arguments but 1 was given.
  • The decorator deploys the function at import time (builds image, uploads, registers).
  • Calling the decorated function (some_function("world")) invokes it remotely and returns the result.

Required env vars

The SDK reads creds from env, not from chalk CLI config. The env var is CHALK_ENVIRONMENT_ID, not CHALK_ENVIRONMENT.

CHALK_API_SERVER
CHALK_CLIENT_ID
CHALK_CLIENT_SECRET
CHALK_ENVIRONMENT_ID

You can read these out of chalk config output for the current project. Example invocation:

CHALK_API_SERVER=... CHALK_CLIENT_ID=... CHALK_CLIENT_SECRET=... CHALK_ENVIRONMENT_ID=... ./your_script.py

Without CHALK_ENVIRONMENT_ID you'll get a permission_denied error from CustomImageService.GetOrBuildCustomImage even though CHALK_CLIENT_ID/CHALK_CLIENT_SECRET are valid.

Local SDK source

If chalkcompute isn't on the configured index (e.g. the script can't resolve chalkcompute from PyPI), point uv at a local checkout of chalk-sandbox-sdk:

# [tool.uv.sources]
# chalkcompute = { path = "/path/to/chalk-sandbox-sdk" }

Verwandte Aufgaben

aus demselben Repository

Weitere Skills

Alle Skills
chalk-ai
Community

accelerate-python-resolvers

Make Chalk Python resolvers statically accelerable. Use when the user asks to accelerate resolvers, fix static-acceleration diagnostics, check why a resolver "can't be accelerated", or speed up Python feature pipelines in a Chalk project (a repo with chalk.yaml/chalk.yml).

Installationen / 1h
3
GitHub Stars
0
Aktualisiert
15. Sept.
chalk-ai
Community

benchmark-vllm-model

Benchmark throughput and cost-per-token of a model served on vLLM in Chalk's container infrastructure. Use when someone asks for $/token, $/request, tokens/sec, "how much would it cost to self-host this model", GPU sizing for an LLM, or wants to compare a self-hosted model's economics against a hosted API.

Installationen / 1h
3
GitHub Stars
0
Aktualisiert
15. Sept.
chalk-ai
Community

chalk-hello

Print a friendly greeting from the Chalk plugin marketplace, used to verify plugin installation.

Installationen / 1h
3
GitHub Stars
0
Aktualisiert
15. Sept.
chalk-ai
Community

debug-plan-cache-misses

Find and debug Chalk query plan cache misses from engine logs. Use when a query is replanning on every request, an "ad-hoc query request missed the plan cache" warning shows up, latency spikes from repeated planning, or someone asks why two seemingly identical queries don't share a cached plan. Drives the chalk logs CLI search.

Installationen / 1h
3
GitHub Stars
0
Aktualisiert
15. Sept.