@blaxel/vercel 0.2.6 → 0.2.7-preview.7

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.
Files changed (2) hide show
  1. package/README.md +134 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # Blaxel Typescript SDK
2
+
3
+ <p align="center">
4
+ <img src="https://blaxel.ai/logo.png" alt="Blaxel"/>
5
+ </p>
6
+
7
+ **Blaxel is a computing platform for AI agent builders, with all the services and infrastructure to build and deploy agents efficiently.** This repository contains the TypeScript SDK to interact with Blaxel resources using Vercel AI SDK format.
8
+
9
+
10
+ ## Table of Contents
11
+
12
+ - [Installation](#installation)
13
+ - [Optional libraries](#optional-libraries)
14
+ - [Authentication](#authentication)
15
+ - [Features](#features)
16
+ - [Quickstart](#quickstart)
17
+ - [Contributing](#contributing)
18
+ - [License](#license)
19
+
20
+
21
+
22
+ ## Installation
23
+
24
+ Install Blaxel SDK for Vercel AI SDK, which lets you retrieve Blaxel resources in Vercel AI SDK format.
25
+
26
+ ```bash
27
+ ## npm
28
+ npm install @blaxel/vercel
29
+
30
+ ## pnpm
31
+ pnpm i @blaxel/vercel
32
+
33
+ ## yarn
34
+ yarn add @blaxel/vercel
35
+ ```
36
+
37
+
38
+ ### Optional libraries
39
+ Blaxel SDK is split between multiple packages. *core* is the minimal package to connect to Blaxel. You can find other packages to help you integrate with your favorite AI framework, or set up telemetry.
40
+
41
+ - [@blaxel/telemetry](@blaxel/telemetry/README.md)
42
+ - [@blaxel/core](@blaxel/core/README.md)
43
+
44
+ Instrumentation happens automatically when workloads run on Blaxel. To enable telemetry, simply require the SDK in your project's entry point.
45
+ ```ts
46
+ import "@blaxel/telemetry";
47
+ ```
48
+
49
+
50
+ ### Authentication
51
+
52
+ The Blaxel SDK authenticates with your workspace using credentials from these sources, in priority order:
53
+ 1. When running on Blaxel, authentication is handled automatically
54
+ 2. Variables in your .env file (`BL_WORKSPACE` and `BL_API_KEY`, or see [this page](https://docs.blaxel.ai/Agents/Variables-and-secrets) for other authentication options).
55
+ 3. Environment variables from your machine
56
+ 4. Configuration file created locally when you log in through Blaxel CLI (or deploy on Blaxel)
57
+
58
+ When developing locally, the recommended method is to just log in to your workspace with Blaxel CLI. This allows you to run Blaxel SDK functions that will automatically connect to your workspace without additional setup. When you deploy on Blaxel, this connection persists automatically.
59
+
60
+ When running Blaxel SDK from a remote server that is not Blaxel-hosted, we recommend using environment variables as described in the third option above.
61
+
62
+
63
+
64
+ ## Features
65
+ - [Connect to MCP servers hosted on Blaxel](https://docs.blaxel.ai/Agents/Develop-an-agent-ts)
66
+ - [Connect to model APIs hosted on Blaxel](https://docs.blaxel.ai/Agents/Develop-an-agent-ts)
67
+
68
+
69
+ ## Connect to MCP server tools and models on Blaxel
70
+
71
+ ```ts
72
+ // With Vercel AI
73
+ import { blTools, blModel } from "@blaxel/vercel";
74
+
75
+ const stream = streamText({
76
+ model: await blModel("gpt-4o-mini"),
77
+ messages: [{ role: "user", content: process.argv[2] }],
78
+ system: prompt,
79
+ tools: {
80
+ ...(await blTools(["blaxel-search", "webcrawl"])),
81
+ weather: tool({
82
+ description: "Get the weather in a specific city",
83
+ parameters: z.object({
84
+ city: z.string(),
85
+ }),
86
+ execute: async (input) => {
87
+ console.debug("TOOLCALLING: local weather", input);
88
+ return `The weather in ${input.city} is sunny`;
89
+ },
90
+ }),
91
+ },
92
+ maxSteps: 5,
93
+ });
94
+ ```
95
+
96
+
97
+ ## Quickstart
98
+
99
+ Blaxel CLI gives you a quick way to create new applications: agents, MCP servers, jobs, etc - and deploy them to Blaxel.
100
+
101
+ **Prerequisites**:
102
+ - **Node.js:** v18 or later.
103
+ - **Blaxel CLI:** Make sure you have Blaxel CLI installed. If not, [install it](https://docs.blaxel.ai/cli-reference/introduction):
104
+ ```bash
105
+ curl -fsSL \
106
+ https://raw.githubusercontent.com/blaxel-ai/toolkit/main/install.sh \
107
+ | BINDIR=/usr/local/bin sudo -E sh
108
+ ```
109
+ - **Blaxel login:** Login to Blaxel:
110
+ ```bash
111
+ bl login YOUR-WORKSPACE
112
+ ```
113
+
114
+ ```bash
115
+ bl create-agent-app myfolder
116
+ cd myfolder
117
+ bl deploy
118
+ ```
119
+
120
+ Also available:
121
+ - `bl create-mcp-server`
122
+ - `bl create-job`
123
+
124
+
125
+
126
+ ## Contributing
127
+
128
+ Contributions are welcome! Please feel free to submit a Pull Request.
129
+
130
+
131
+
132
+ ## License
133
+
134
+ This project is licensed under the MIT License - see the LICENSE file for details.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blaxel/vercel",
3
- "version": "0.2.6",
3
+ "version": "0.2.7-preview.7",
4
4
  "description": "Blaxel SDK for TypeScript",
5
5
  "license": "MIT",
6
6
  "author": "Blaxel, INC (https://blaxel.ai)",
@@ -59,7 +59,7 @@
59
59
  "@ai-sdk/groq": "^1.2.8",
60
60
  "@ai-sdk/openai": "^1.3.21",
61
61
  "ai": "^4.3.13",
62
- "@blaxel/core": "0.2.6"
62
+ "@blaxel/core": "0.2.7-preview.7"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@eslint/js": "^9.26.0",