Crates.io | amsterdam |
lib.rs | amsterdam |
version | 0.0.4 |
source | src |
created_at | 2024-10-30 21:57:15.98333 |
updated_at | 2024-11-10 11:59:36.257169 |
description | A gateway for observing, routing, and transforming prompts. |
homepage | |
repository | |
max_upload_size | |
id | 1429286 |
size | 127,675 |
Routing: route requests to suitable LLM providers, (possibly using something like https://github.com/lm-sys/RouteLLM)
Monitoring:
Tracking: group requests by templates / tags and threads
Modifying: allow requests to specify what parts of a prompt are variable, store the templates in a database, and experiment with different templates.
The gateway has endpoints that mimic LLM API endpoints, but with additional fields to support the features above.
For example for the OpenAI API the request body would look like this:
"messages": [
{
"role": "user",
"content": "Hello Tinco!"
"template": "Hello {{ name }}!",
"template_id": "bla_template-v1.2321beta5",
"variables": {
"name": "Tinco"
}
}
],
"agent_id": "greeting-agent-v1.1231beta5",
"run_id": "abcdef123",
"request_parent_id": "abcdef123",
"request_id": "abcdef123"
template_id
allows us to easily group requests.Gateway endpoints start with /v<version>/<provider>
, for example /v1/openai/v1/chat/completions
. To ensure
compatibility, the requests are proxied to the provider as-is, with the additional fields stripped off.