DEV Community

tanya rai
tanya rai

Posted on • Updated on

Building with generative AI 🚀


In this tutorial, we'll show you how to streamline the way you integrate generative AI models into production!

LastMile AI - dev platform for generative AI 🚀

A quick background about LastMile AI. We are a developer platform for engineering teams to go from prototype to production with generative AI models. Our platform is multi-modal and model-agnostic so you aren't tied to dependencies on a single provider.

We recently launched our first open-source project AIConfig! Check us out and give us feedback ⭐️:

Demo Video -

Image description

1. Let's get started

First, go to and sign in for free.

You'll land on an AI Workbook. AI Workbooks are a notebook-like interface where you can experiment text, image, and audio AI models from various providers. You can prototype and parametrize your prompt chains all in a single place.


2. Write your prompt chains

We are going to prototype a simple trip planner.

First prompt:

  1. Select 'ChatGPT' as model (should be default).
  2. Add global parameter 'city' with value 'London'.
  3. Name cell as 'get_activities'
  4. Write prompt 'Tell me the top 5 fun attractions in {{city}}'


For our second prompt:

  1. Add a new cell but change model to 'GPT4'.
  2. Add a local parameter for the cell {{cuisine}}.
  3. Add a system prompt to format the response (see image)
  4. Write prompt 'generate a one-day personalized itinerary based on 1/ my favorite cuisine: {{cuisine}}, 2/ list of activities: {{get_activities.output}}'


AI Workbook -

3. Download your AIConfig

AIConfig is a JSON serializable format that contains your prompts, model parameters, and settings. It is essentially your generative AI artifact to be managed in source control and easily shared across applications.


4. Use AIConfig in your application code

Here are a few of the python SDK commands on how you can use AIConfig easily in your application code.

But first why store your generative AI components in a config? It enables you to:

  • Decouple your application code from the generative AI components which decreases complexity
  • Manage your generative AI components in source control
  • Evaluate and monitor performance across models
  • Iterate fast - switch models and try different parameters

Colab Notebook:

Install python package

AIConfig SDK is available in python and Typescript.


Load your AI Config


Run your prompt


Run prompt with different parameter value


Add a new prompt to your AIConfig


Save outputs in your AIConfig


AIConfig is our first open-source project and we'd love your help. See our contributing guidelines -- we would especially love help adding support for additional models that the community wants.

Top comments (1)

andrewlastmile profile image