Create Numerai Tournament model upload pickles (.pkl) with a self-contained predict() function. Use when preparing upload artifacts, debugging numerai_predict import errors, or documenting model-upload requirements and testing steps.
Create a portable predict(live_features, live_benchmark_models) pickle that runs inside Numerai's numerai_predict container without repo dependencies.
Before creating any pkl file, you must ensure your Python environment matches Numerai's compute environment. Mismatched versions cause segfaults and validation failures due to binary incompatibility (especially with numpy).
If the numerai MCP server is available, always query the default Python version first:
query { computePickleDockerImages { id name image tag default } }
Look for the entry with default: true. The image name indicates the Python version:
numerai_predict_py_3_12:a78dedd → Python 3.12 (current default as of 2026)numerai_predict_py_3_11:a78dedd → Python 3.11numerai_predict_py_3_10:a78dedd → Python 3.10If the numerai MCP is not installed, it can be installed through our install script via curl -sL https://numer.ai/install-mcp.sh | bash, this script guides the user through installing the MCP for Codex CLI and configuring an API key with the correct scopes that are required by MCP.
You can find more documentation about Numerai MCP here: https://docs.numer.ai/numerai-tournament/mcp
Use pyenv to create a virtual environment with the exact Python version:
# 1. List available pyenv Python versions
ls ~/.pyenv/versions/
# 2. Find the matching minor version (e.g., for Python 3.12)
PYENV_PY=$(ls -d ~/.pyenv/versions/3.12.* 2>/dev/null | head -1)
# 3. Create the virtual environment
$PYENV_PY/bin/python -m venv ./venv
# 4. Activate and install pkl dependencies
source ./venv/bin/activate
pip install --upgrade pip
pip install numpy pandas cloudpickle scipy
# Add lightgbm, torch, etc. only if your model needs them
Always create pkl files using the matching venv:
./venv/bin/python create_model_pkl.py
predict(live_features, live_benchmark_models) and return a DataFrame with a prediction column aligned to the input index.agents.*), because Numerai's container will not have them.era for per-era ranking, benchmark column if used).predict function that:
cloudpickle.dump(predict, "model.pkl") using the matching venv's Python.Run the Numerai debug container locally (use the same image tag as the default):
# Get the default image tag from MCP query, then test:
docker run -i --rm -v "$PWD:$PWD" ghcr.io/numerai/numerai_predict_py_3_12:a78dedd --debug --model $PWD/[PICKLE_FILE]
ImportError: No module named 'agents': occurs when the pickle references repo classes. Fix by exporting a pure-numpy inference bundle and rebuilding predict without repo imports.era column: per-era ranking requires live_features["era"].live_benchmark_models is reindexed to live_features (by id) before use.If your pickle fails validation, query the trigger status and logs:
query {
account {
models {
username
computePickleUpload {
filename
validationStatus
triggerStatus
triggers {
id
status
statuses {
status
description
insertedAt
}
}
}
}
}
}
Common error descriptions:
"Segmentation fault! Ensure python and library versions match our environment." → Python/numpy version mismatch"No currently open rounds!" → Model validated successfully but no round is open for submissionnumerai/example_model.ipynb for the expected predict signature and output format.After creating and testing your pkl file, you can deploy it to Numerai using the Numerai MCP server. The MCP server provides tools for creating models and uploading pkl files programmatically.
The numerai MCP server provides these key tools:
check_api_credentials - Verify your API token and see granted scopescreate_model - Create a new model in a tournamentupload_model - Upload pkl files (multi-step workflow)graphql_query - List existing models and perform custom queriesAll authenticated operations require a Numerai API token with upload_submission scope:
PUBLIC_ID$SECRET_KEYIf you already have a model slot you want to use:
List your models using graphql_query:
query {
account { models { id name } }
}
Get upload authorization for your pkl file:
upload_model with operation: "get_upload_auth", modelId: "<model_uuid>", filename: "model.pkl"Upload the pkl file
Register the upload with Numerai:
upload_model with operation: "create", modelId: "<model_uuid>", filename: "model.pkl"Check validation status:
upload_model with operation: "list" to see all pickles and their statusAssign the pickle to the model slot:
upload_model with operation: "assign", modelId: "<model_uuid>", pickleId: "<pickle_uuid>"If you want to create a new model slot:
Create the model:
create_model with name: "<unique_model_name>", tournament: 8 (for Classic)Get the model ID from the response
Follow steps 2-6 from Option 1 to upload and assign the pkl file
┌─────────────────────────────────────────────────────────────────┐
│ PKL DEPLOYMENT WORKFLOW │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. Create pkl file (this skill's main workflow) │
│ 2. Test pkl locally with numerai_predict container │
│ 3. Choose: create new model OR use existing model │
│ │
│ For new model: │
│ └─> create_model(name, tournament=8) │
│ │
│ For existing model: │
│ └─> graphql_query to list models and get model ID │
│ │
│ 4. upload_model(operation="get_upload_auth", modelId, filename)│
│ 5. upload_model(operation="put_file", presignedUrl, localPath) │
│ 6. upload_model(operation="create", modelId, filename) │
│ 7. upload_model(operation="list") - wait for validation │
│ 8. upload_model(operation="assign", modelId, pickleId) │
│ │
│ Optional: │
│ - upload_model(operation="trigger", pickleId) to test │
│ - upload_model(operation="get_logs", pickleId, triggerId) │
│ │
└─────────────────────────────────────────────────────────────────┘
query { computePickleDockerImages { id name image tag default } }
upload_model(operation="list_data_versions") to see available dataset versionsBefore uploading a pkl file, verify:
computePickleDockerImages to get the default Python versionAfter assigning a pickle, you can manually trigger it for testing:
Trigger the pickle:
upload_model with operation: "trigger", pickleId: "<pickle_uuid>", triggerValidation: trueView execution logs:
upload_model with operation: "get_logs", pickleId: "<pickle_uuid>", triggerId: "<trigger_uuid>"Before deploying, confirm with the user:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer