{"id":27659,"library":"codeflare-sdk","title":"CodeFlare SDK","description":"Python SDK for CodeFlare, providing high-level abstractions to deploy and manage Ray clusters on Kubernetes, with integrated job submission and resource management. Current version 0.37.0, requires Python >=3.11, <4.0, and is actively maintained with monthly releases.","status":"active","version":"0.37.0","language":"python","source_language":"en","source_url":"https://github.com/project-codeflare/codeflare-sdk","tags":["ray","kubernetes","distributed-computing","ml","cluster-management"],"install":[{"cmd":"pip install codeflare-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Used to interact with Kubernetes API for cluster management.","package":"kubernetes","optional":false},{"reason":"Core distributed computing library that CodeFlare orchestrates.","package":"ray","optional":false}],"imports":[{"note":"Wrong module name: the correct package is 'codeflare_sdk', not 'codeflare'.","wrong":"from codeflare.cluster import Cluster","symbol":"Cluster","correct":"from codeflare_sdk import Cluster"},{"note":"ClusterConfiguration is exported from the top-level package, not from a submodule.","wrong":"from codeflare_sdk.config import ClusterConfiguration","symbol":"ClusterConfiguration","correct":"from codeflare_sdk import ClusterConfiguration"}],"quickstart":{"code":"from codeflare_sdk import Cluster, ClusterConfiguration\nimport os\n\n# Define cluster configuration\nconfig = ClusterConfiguration(\n    name='example-cluster',\n    namespace='default',\n    num_workers=2,\n    head_cpus='500m',\n    head_memory='2Gi',\n    worker_cpus='1',\n    worker_memory='4Gi',\n    min_workers=1,\n    max_workers=4,\n)\n\n# Create and start the cluster\ncluster = Cluster(config)\ncluster.up()\n# Wait for cluster to be ready\ncluster.wait_ready()\nprint(f\"Ray URI: {cluster.cluster_uri()}\")\n# Submit a simple Ray job\nimport ray\nray.init(cluster.cluster_uri())\n@ray.remote\ndef hello():\n    return \"Hello from Ray cluster\"\nprint(ray.get(hello.remote()))\n# Tear down\ncluster.down()","lang":"python","description":"Create a Ray cluster on Kubernetes, run a remote function, and tear down."},"warnings":[{"fix":"Migrate to Kuberay-based configurations. Remove any AppWrapper references.","message":"AppWrapper support removed in v0.34.0. Instantiation of Ray clusters now relies solely on Kuberay operator; any code using AppWrapper objects will break.","severity":"breaking","affected_versions":">=0.34.0"},{"fix":"Upgrade the Kuberay operator to a compatible version. Ensure Ray image aligns with the SDK's default.","message":"In v0.33.0, the immutable image tag for Ray was updated to Ray v2.52.1. Clusters created with older SDK versions (pre-0.33.0) may fail if the operator is not updated.","severity":"breaking","affected_versions":">=0.33.0"},{"fix":"Use only lowercase alphanumeric characters and hyphens; no underscores or uppercase.","message":"Cluster name must be a valid Kubernetes resource name (lowercase RFC 1123 subdomain). Since v0.36.0, invalid names cause early errors.","severity":"gotcha","affected_versions":">=0.36.0"},{"fix":"Replace any references to codeflare-operator with kuberay in your cluster configuration or environment.","message":"Usage of 'codeflare-operator' is deprecated; all operator references have been replaced with 'kuberay' in v0.35.0. Old cluster configurations may stop working.","severity":"deprecated","affected_versions":">=0.35.0"}],"env_vars":null,"search_vec":"'0.37.0':29 '3.11':32 '4.0':33 'abstract':11 'activ':36 'cluster':17,48 'cluster-manag':47 'codeflar':1,6 'comput':45 'current':27 'deploy':13 'distribut':44 'distributed-comput':43 'high':9 'high-level':8 'integr':21 'job':22 'kubernet':19,42 'level':10 'maintain':37 'manag':15,26,49 'ml':46 'month':39 'provid':7 'python':3,31 'ray':16,41 'releas':40 'requir':30 'resourc':25 'sdk':2,4 'submiss':23 'version':28","created_at":"2026-05-09T05:51:24.960643+00:00","updated_at":"2026-05-09T05:51:24.960643+00:00","problems":[{"fix":"Install the package (pip install codeflare-sdk) and import as 'from codeflare_sdk import Cluster'.","cause":"Incorrect import path; the package is named 'codeflare_sdk', not 'codeflare'.","error":"ModuleNotFoundError: No module named 'codeflare'"},{"fix":"Use a lowercase name with only hyphens and alphanumeric characters, e.g., 'mycluster-1'.","cause":"Cluster name contains uppercase letters or underscores, which violates RFC 1123.","error":"ValueError: Invalid cluster name 'MyCluster_1'. Must be a valid Kubernetes resource name"},{"fix":"Ensure Kuberay operator is installed and use ClusterConfiguration without AppWrapper-related settings.","cause":"AppWrapper CRD is no longer available in the cluster; requires Kuberay operator.","error":"ClusterError: Failed to get RayCluster resource: 'appwrapper.codeflare.codeflare.dev \"...\" not found'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://codeflare.dev","github":"https://github.com/project-codeflare/codeflare-sdk","docs":null,"changelog":null,"pypi":"https://pypi.org/project/codeflare-sdk/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","workflow","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}