<jupyter_start><jupyter_text>Spell Integration NotebookLet's get started on using Arize with Spell!✨Arize helps you visualize your model performance, understand drift & data quality issues, and share insights learned from your models. Spell is an end-to-end ML platform that provides infrastructure for company to deploy and train models.In this notebook, we show how to integrate Arize with Spell quickly.1. **Step 1:** Logging into `spell` via command line.2. **Step 2:** Train and create model with spell.**Note:** Arize also allows you to log your training and validation. See [our documentation page here](https://arize.gitbook.io/arize/apis/python-sdk-1/arize.log_training_records)3. **Step 3:** Add your Arize `API_KEY` and `ORG_KEY` to `serve_async.py` and `server_sync.py`.4. **Step 4:** Creating your model your model and serving it.5. **Step 5:** Test your working instance, send in some data, and see that your model is observable on Arize platform.[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/Arize-ai/client_python/blob/main/arize/examples/tutorials/Arize_Tutorial_Spell_Integration.ipynb)  Step 1: Logging into Spell<jupyter_code># First, we need to clone the repos so we have access to the .py files from within the notebook
!git clone https://github.com/spellml/examples.git
%cd examples/arize
!spell login
print('Step 1 ✅: Logging and obtained required files')<jupyter_output><empty_output><jupyter_text>Step 2: Model Training<jupyter_code>! spell run \
    --github-url https://github.com/spellml/examples \
    --machine-type cpu \
    --mount public/tutorial/churn_data/:/mnt/churn_prediction/ \
    --pip arize --pip lightgbm \
    -- python arize/train.py
print('Step 2 ✅: Model Training Complete!')<jupyter_output><empty_output><jupyter_text>Step 3: Adding API and ORG Key from ArizeYou can obtain your API and ORG key from your [Arize Setting Page](https://app.arize.com/admin).  Step 4: Creating and Serving ModelYou can find your model's run ID under [Runs](https://web.spell.ml/runs), or simply copy the number displayed: **💫 Casting spell $RUN_ID**.<jupyter_code>!spell model create churn-prediction 'runs/$RUN_ID'
!spell server serve \
  --node-group default \
  --min-pods 1 --max-pods 3 \
  --target-requests-per-second 100 \
  --pip lightgbm --pip arize \
  --env ARIZE_ORG_KEY=$ARIZE_ORG_KEY \
  --env ARIZE_API_KEY=$ARIZE_API_KEY \
  churn-prediction:v1 serve_sync.py  # or serve_async.py<jupyter_output><empty_output><jupyter_text>Step 5: Testing your serverYou can find details on `REGION` and `CLUSTER` on your [Servers page](https://web.spell.ml/servers). Copy those into the cell below, and you should receive the result:`{"result":[1.0]}%`<jupyter_code>!curl -X POST -d '@test_payload.txt' \
    https://$REGION.$CLUSTER.spell.services/$ORGANIZATION/churn-prediction/predict<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11823166552433173, 'fraction_numerical': 0.008910212474297465, 'mean_word_length': 4.701171875, 'pattern_counts': {'":': 1, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '416547', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 982, 'n_tokens_neox': 945, 'n_words': 295, 'path': 'arize/examples/tutorials/Partnerships/Arize_Tutorial_Spell_Integration.ipynb', 'repo_name': 'henryShelf/client_python', 'size': '2918'}