TL;DR
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 βοΈ: https://github.com/lastmile-ai/aiconfig
Demo Video - https://www.youtube.com/watch?v=ej85StfHEFo
1. Let's get started
First, go to www.lastmileai.dev 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:
- Select 'ChatGPT' as model (should be default).
- Add global parameter '
city
' with value 'London'. - Name cell as '
get_activities
' - Write prompt 'Tell me the top 5 fun attractions in
{{city}}
'
For our second prompt:
- Add a new cell but change model to 'GPT4'.
- Add a local parameter for the cell
{{cuisine}}
. - Add a system prompt to format the response (see image)
- Write prompt 'generate a one-day personalized itinerary based on 1/ my favorite cuisine:
{{cuisine}}
, 2/ list of activities:{{get_activities.output}}
'
AI Workbook - https://lastmileai.dev/workbooks/clpdo3pnl019dpejj3kvl49g2
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: https://colab.research.google.com/drive/1RlGQmtR0uK7OTI5nG10E219JoH2mgAQr#scrollTo=Kd6BFPGiHPJe
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.
βοΈ https://github.com/lastmile-ai/aiconfig
Top comments (1)
π₯