Skip to main content

Run your first AI service locally

This walks you through the AgriFoodData Starter Kit — from install to a running service that ingests data, processes it, and writes results back.

Prerequisites​

  • OS — Windows, macOS, or Linux
  • Python 3.10+
  • Docker 20.10+
  • Git (recommended)

Verify:

python --version    # Python 3.10.x or higher
docker --version # Docker version 20.10.x or higher

1. Install the AgriFoodData SDK​

Which SDK?

This is the SDK for AI services — workers that are commissioned through a queue and write results back. To build an app that signs people in and calls the digital farm API, use the Application SDK and the Getting started guide instead.

pip install git+https://github.com/NaLamKI/SDK
pip show nalamkisdk

The SDK repo and the import name will move to agrifooddata as part of the ongoing rebrand — see the Roadmap.

2. Clone the AgriFoodData Starter Kit​

git clone https://github.com/NaLamKI/Starterkit.git
cd Starterkit

3. Set up a virtualenv and install​

python -m venv venv
source venv/bin/activate # macOS/Linux
# venv\Scripts\activate # Windows
pip install -r src/requirements.txt

4. Run the example service​

The default starter detects green colours in images — a placeholder for a real vegetation/crop model.

python test/test.py

Inputs are read from test/action/input/, outputs land in test/action/output/.

To visualise the outputs:

python src/visualize_outputs.py

5. What just happened​

  1. The service loads images from test/action/input/.
  2. It processes each image (here: green-pixel detection).
  3. It writes results to test/action/output/.
  4. The visualisation script renders them.

Project structure​

StarterKit/
├── src/ # Your service code
│ ├── service.py # Main service class
│ ├── requirements.txt
│ └── visualize_outputs.py
├── test/ # Local test harness
│ ├── service.py
│ ├── test.py
│ └── action/
│ ├── input/
│ └── output/
└── Dockerfile

Next steps​