chalk-ai/chalk-ai-plugins

deploy-chalk-function

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

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/chalk-ai/chalk-ai-plugins --skill deploy-chalk-function

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

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" }

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills