Manifest is meant to be a very light weight package to help with prompt iteration. Two key design decisions are
## Getting Started
Running is simple to get started. If using OpenAI, set `export OPENAI_API_KEY=<OPENAIKEY>` then run
```python
from manifest import Manifest
# Start a manifest session
manifest = Manifest(
client_name = "openai",
)
manifest.run("Why is the grass green?")
```
We also support AI21, OPT models, and HuggingFace models (see [below](#huggingface-models)).
Caching by default is turned off, but to cache results, run
```python
from manifest import Manifest
# Start a manifest session
manifest = Manifest(
client_name = "openai",
cache_name = "sqlite",
cache_connection = "mycache.sqlite",
)
manifest.run("Why is the grass green?")
```
We also support Redis backend.
## Manifest Components
Manifest is meant to be a very light weight package to help with prompt iteration. Three key design decisions are
* Prompt are functional -- they can take an input example and dynamically change
* All models are behind API calls (e.g., OpenAI)
* Everything is cached for reuse to both save credits and to explore past results
* Everything can cached for reuse to both save credits and to explore past results
## Prompts
### Prompts
A Manifest prompt is a function that accepts a single input to generate a string prompt to send to a model.
```python
from manifest import Prompt
prompt = Prompt(lambda x: "Hello, my name is {x}")
print(prompt("Laurel"))
>>> "Hello, my name is Laurel"
```
We also let you use static strings
```python
prompt = Prompt("Hello, my name is static")
@ -41,9 +75,7 @@ print(prompt())
>>> "Hello, my name is static"
```
**Chaining prompts coming soon**
## Sessions
### Sessions
Each Manifest run is a session that connects to a model endpoint and backend database to record prompt queries. To start a Manifest session for OpenAI, make sure you run