β Create
An AI Pipeline is defined in a simple YAML file.
Check out different AI Pipeline examples.
Basic Exampleβ
A basic text generation AI Pipeline that uses the default Prompt Template, has a predefined System Prompt (instructs the AI Model on how to generally act) and connects to the default built-in Text AI Model (LLM)
kind: floom/pipeline/1.2
pipeline:
name: my-first-pipeline
prompt:
template:
package: floom/prompt/template/default
system: "You are a nice assistant"
You can learn more about AI Pipeline objects.
Save this pipeline configuration YAML to 'my-first-pipeline.yml'.
Production Exampleβ
A robust production AI Pipeline scenario, including Plugins: Caching, Cost Management, Prompt Validation and Response Validation executed on OpenAI GPT-3.5.
The AI Pipeline incorporates the "tutorial.pdf" file as Context (RAG). Consequently, the AI Model will be equipped with the knowledge contained in "tutorial.pdf".
kind: 'floom/pipeline/1.2'
pipeline:
name: my-first-pipeline
# Use π§ OpenAI-GPT 3.5
model:
- package: floom/model/connectors/openai
model: gpt-3.5
api-key: sk-1234567890abcdefg=
prompt:
template:
package: floom/prompt/templates/default
system: "You are helpful assistant"
# π tutorial.pdf as context
context:
- package: floom/prompt/context/pdf
path: /etc/tutorial.pdf
# β Filter Profanity
validation:
- package: floom/plugins/bad-words-filter
disallow: ['profanity']
response:
# βοΈ Response should be 3 sentences max, in English (US)
format:
- package: floom/response/formatter
type: text
language: en-us
max-sentences: 3
# β Filter Profanity & Negativity
validation:
- package: floom/plugins/bad-words-filter
disallow: ['profanity', 'negativity']
language: en-us
global:
# π΅ Cost limit
- package: floom/plugins/cost-management
limits:
user:
- day: 1000 # max tokens per day
pipeline:
- month: 600000 # max tokens per month
# β‘Caching
- package: floom/plugins/cache
cache-type: memory