substrai-lambdallm 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -0
- package/index.d.ts +24 -0
- package/index.js +57 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# substrai-lambdallm
|
|
2
|
+
|
|
3
|
+
**Serverless-native LLM orchestration framework for AWS Lambda.**
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/substrai-lambdallm/)
|
|
6
|
+
[](https://github.com/substrai/lambdallm)
|
|
7
|
+
[](https://substrai.github.io/lambdallm)
|
|
8
|
+
|
|
9
|
+
> **Note:** The primary implementation is in Python. TypeScript SDK coming soon.
|
|
10
|
+
|
|
11
|
+
## Install (Python)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install substrai-lambdallm[bedrock]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from lambdallm import handler, Prompt, Model
|
|
21
|
+
|
|
22
|
+
@handler(model=Model.CLAUDE_3_HAIKU)
|
|
23
|
+
def lambda_handler(event, context):
|
|
24
|
+
result = context.invoke("Summarize: {text}", text=event["body"]["text"])
|
|
25
|
+
return {"statusCode": 200, "body": result}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Features
|
|
29
|
+
|
|
30
|
+
- < 5MB package (vs 400MB+ for LangChain)
|
|
31
|
+
- Cold-start optimized (lazy imports, connection pooling)
|
|
32
|
+
- DynamoDB-native state (conversation memory persists)
|
|
33
|
+
- Multi-step chains with checkpoint/resume
|
|
34
|
+
- AI Agents with tool sandboxing
|
|
35
|
+
- Cost-aware model routing
|
|
36
|
+
- One-command deploy
|
|
37
|
+
- A/B testing for prompts
|
|
38
|
+
- Full observability (X-Ray + CloudWatch)
|
|
39
|
+
|
|
40
|
+
## Links
|
|
41
|
+
|
|
42
|
+
- [Documentation](https://substrai.github.io/lambdallm)
|
|
43
|
+
- [GitHub](https://github.com/substrai/lambdallm)
|
|
44
|
+
- [PyPI](https://pypi.org/project/substrai-lambdallm/)
|
|
45
|
+
|
|
46
|
+
## Author
|
|
47
|
+
|
|
48
|
+
**Gaurav Kumar Sinha** — Founder, [SubstrAI](https://github.com/substrai)
|
|
49
|
+
|
|
50
|
+
Email: gaurav@substrai.dev
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare module "substrai-lambdallm" {
|
|
2
|
+
export const version: string;
|
|
3
|
+
export const author: string;
|
|
4
|
+
export const email: string;
|
|
5
|
+
export const homepage: string;
|
|
6
|
+
export const repository: string;
|
|
7
|
+
export const pypi: string;
|
|
8
|
+
export const install: string;
|
|
9
|
+
export const status: string;
|
|
10
|
+
export const typescript_sdk: string;
|
|
11
|
+
|
|
12
|
+
export const models: {
|
|
13
|
+
CLAUDE_3_HAIKU: string;
|
|
14
|
+
CLAUDE_3_SONNET: string;
|
|
15
|
+
CLAUDE_3_5_SONNET: string;
|
|
16
|
+
CLAUDE_3_OPUS: string;
|
|
17
|
+
TITAN_TEXT_EXPRESS: string;
|
|
18
|
+
TITAN_TEXT_LITE: string;
|
|
19
|
+
LLAMA3_8B: string;
|
|
20
|
+
LLAMA3_70B: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const features: string[];
|
|
24
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SubstrAI LambdaLLM - Serverless-native LLM orchestration framework.
|
|
3
|
+
*
|
|
4
|
+
* This is the npm placeholder for the LambdaLLM framework.
|
|
5
|
+
* The primary implementation is in Python: pip install substrai-lambdallm
|
|
6
|
+
*
|
|
7
|
+
* TypeScript SDK coming soon.
|
|
8
|
+
*
|
|
9
|
+
* @see https://github.com/substrai/lambdallm
|
|
10
|
+
* @see https://substrai.github.io/lambdallm
|
|
11
|
+
* @see https://pypi.org/project/substrai-lambdallm/
|
|
12
|
+
* @author Gaurav Kumar Sinha <gaurav@substrai.dev>
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
"use strict";
|
|
16
|
+
|
|
17
|
+
const MODELS = {
|
|
18
|
+
CLAUDE_3_HAIKU: "anthropic.claude-3-haiku-20240307-v1:0",
|
|
19
|
+
CLAUDE_3_SONNET: "anthropic.claude-3-sonnet-20240229-v1:0",
|
|
20
|
+
CLAUDE_3_5_SONNET: "anthropic.claude-3-5-sonnet-20241022-v2:0",
|
|
21
|
+
CLAUDE_3_OPUS: "anthropic.claude-3-opus-20240229-v1:0",
|
|
22
|
+
TITAN_TEXT_EXPRESS: "amazon.titan-text-express-v1",
|
|
23
|
+
TITAN_TEXT_LITE: "amazon.titan-text-lite-v1",
|
|
24
|
+
LLAMA3_8B: "meta.llama3-8b-instruct-v1:0",
|
|
25
|
+
LLAMA3_70B: "meta.llama3-70b-instruct-v1:0",
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const FEATURES = [
|
|
29
|
+
"handler-decorator",
|
|
30
|
+
"prompt-templates",
|
|
31
|
+
"multi-step-chains",
|
|
32
|
+
"ai-agents",
|
|
33
|
+
"tool-registry",
|
|
34
|
+
"dynamodb-sessions",
|
|
35
|
+
"cost-aware-routing",
|
|
36
|
+
"budget-enforcement",
|
|
37
|
+
"xray-tracing",
|
|
38
|
+
"cloudwatch-metrics",
|
|
39
|
+
"ab-testing",
|
|
40
|
+
"canary-deployments",
|
|
41
|
+
"golden-dataset-testing",
|
|
42
|
+
"lambda-response-streaming",
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
module.exports = {
|
|
46
|
+
version: "1.0.0",
|
|
47
|
+
author: "Gaurav Kumar Sinha",
|
|
48
|
+
email: "gaurav@substrai.dev",
|
|
49
|
+
homepage: "https://substrai.github.io/lambdallm",
|
|
50
|
+
repository: "https://github.com/substrai/lambdallm",
|
|
51
|
+
pypi: "https://pypi.org/project/substrai-lambdallm/",
|
|
52
|
+
install: "pip install substrai-lambdallm[bedrock]",
|
|
53
|
+
models: MODELS,
|
|
54
|
+
features: FEATURES,
|
|
55
|
+
status: "stable",
|
|
56
|
+
typescript_sdk: "coming-soon",
|
|
57
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "substrai-lambdallm",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Serverless-native LLM orchestration framework for AWS Lambda. Purpose-built for Lambda's stateless, cold-start-optimized execution model.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"genai",
|
|
9
|
+
"llm",
|
|
10
|
+
"serverless",
|
|
11
|
+
"aws",
|
|
12
|
+
"lambda",
|
|
13
|
+
"bedrock",
|
|
14
|
+
"framework",
|
|
15
|
+
"ai",
|
|
16
|
+
"orchestration",
|
|
17
|
+
"agents",
|
|
18
|
+
"chains",
|
|
19
|
+
"cost-tracking",
|
|
20
|
+
"observability",
|
|
21
|
+
"typescript"
|
|
22
|
+
],
|
|
23
|
+
"author": "Gaurav Kumar Sinha <gaurav@substrai.dev>",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"homepage": "https://substrai.github.io/lambdallm",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/substrai/lambdallm"
|
|
29
|
+
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://github.com/substrai/lambdallm/issues"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18.0.0"
|
|
35
|
+
}
|
|
36
|
+
}
|