-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hyperbolic plugin for ElizaOS preparation to the PR (#2701)
- Loading branch information
Showing
26 changed files
with
2,517 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
* | ||
|
||
!dist/** | ||
!package.json | ||
!readme.md | ||
!tsup.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"correctness": { | ||
"noUnusedVariables": "error" | ||
}, | ||
"suspicious": { | ||
"noExplicitAny": "error" | ||
}, | ||
"style": { | ||
"useConst": "error", | ||
"useImportType": "off" | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 4, | ||
"lineWidth": 100 | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "single", | ||
"trailingCommas": "es5" | ||
} | ||
}, | ||
"files": { | ||
"ignore": [ | ||
"dist/**/*", | ||
"extra/**/*", | ||
"node_modules/**/*" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{ | ||
"name": "@elizaos/plugin-hyperbolic", | ||
"version": "0.1.8+build.1", | ||
"description": "HyperBolic Plugin for ElizaOS", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"type": "module", | ||
"scripts": { | ||
"build": "tsup", | ||
"dev": "tsup --watch", | ||
"clean": "rm -rf dist", | ||
"lint": "biome lint .", | ||
"lint:fix": "biome check --apply .", | ||
"format": "biome format .", | ||
"format:fix": "biome format --write .", | ||
"test": "vitest", | ||
"test:watch": "vitest watch", | ||
"test:coverage": "vitest run --coverage", | ||
"test:ui": "vitest --ui" | ||
}, | ||
"dependencies": { | ||
"@elizaos/core": "workspace:*", | ||
"axios": "^1.6.5", | ||
"chalk": "^5.3.0", | ||
"cli-table3": "^0.6.3", | ||
"dotenv": "^16.4.1", | ||
"ora": "^8.0.1", | ||
"zod": "^3.22.4", | ||
"ssh2": "^1.15.0", | ||
"@coinbase/coinbase-sdk": "^0.15.0", | ||
"viem": "^2.0.0", | ||
"decimal.js": "^10.4.3" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.9.4", | ||
"@types/dotenv": "^8.2.0", | ||
"@types/jest": "^29.5.11", | ||
"@types/node": "^20.11.5", | ||
"@types/ssh2": "^1.11.18", | ||
"@typescript-eslint/eslint-plugin": "^6.19.0", | ||
"@typescript-eslint/parser": "^6.19.0", | ||
"@vitest/coverage-v8": "^1.2.1", | ||
"@vitest/ui": "^0.34.6", | ||
"tsup": "^8.0.1", | ||
"typescript": "^5.3.3", | ||
"vite": "^5.0.10", | ||
"vite-tsconfig-paths": "^4.2.2", | ||
"vitest": "^1.2.1" | ||
}, | ||
"peerDependencies": { | ||
"@elizaos/core": "workspace:*" | ||
}, | ||
"engines": { | ||
"node": ">=18.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
|
||
 | ||
|
||
# Hyperbolic Plugin | ||
A powerful plugin for managing GPU instances on the Hyperbolic platform through Eliza AI. | ||
|
||
## Features | ||
|
||
- List available GPUs with specifications and pricing | ||
- Check account balance | ||
- Monitor GPU instance status | ||
- View spending history | ||
- Rent GPU instances | ||
- Terminate GPU instances | ||
|
||
## Actions | ||
|
||
### 1. GET_HB_AVAILABLE_GPUS | ||
Lists all available GPU machines on the Hyperbolic platform with their specifications and pricing. | ||
|
||
**Example prompt:** | ||
``` | ||
Show me available GPUs on Hyperbolic | ||
``` | ||
|
||
### 2. GET_CURRENT_BALANCE | ||
Checks your current balance on the Hyperbolic platform. | ||
|
||
**Example prompt:** | ||
``` | ||
Show my current balance on Hyperbolic | ||
``` | ||
|
||
### 3. GET_GPU_STATUS | ||
Monitors the status of all your GPU instances. | ||
|
||
**Example prompt:** | ||
``` | ||
Check status of all my GPU instances on Hyperbolic | ||
``` | ||
|
||
### 4. GET_SPEND_HISTORY | ||
Shows your spending history on the Hyperbolic platform. | ||
|
||
**Example prompt:** | ||
``` | ||
Show my spending history on Hyperbolic | ||
``` | ||
|
||
### 5. RENT_HB_COMPUTE | ||
Rents a GPU instance using node ID and cluster name. | ||
|
||
**Example prompt:** | ||
``` | ||
Create a GPU instance on the Hyperbolic | ||
[nodeid]las1-prd-acl-msi-09.fen.intra[/nodeid] | ||
[cluster]circular-snapdragon-worm[/cluster] | ||
``` | ||
|
||
**Required format:** | ||
- Node ID must be wrapped in `[nodeid]` tags | ||
- Cluster name must be wrapped in `[cluster]` tags | ||
|
||
### 6. TERMINATE_COMPUTE | ||
Terminates a running GPU instance. | ||
|
||
**Example prompts:** | ||
``` | ||
Terminate the Hyperbolic instance [gpu]worse-walnut-viper[/gpu] | ||
``` | ||
``` | ||
Terminate the Hyperbolic instance [gpu]puny-clover-basilisk[/gpu] | ||
``` | ||
|
||
**Important Note:** When terminating an instance, you must provide the instance ID wrapped in `[gpu]` tags. The examples above show two different instance IDs (`worse-walnut-viper` and `puny-clover-basilisk`) to demonstrate the format. | ||
|
||
## Configuration | ||
|
||
The plugin requires the following environment variables: | ||
|
||
```bash | ||
HYPERBOLIC_API_KEY=your_api_key_here | ||
HYPERBOLIC_ENV=production # or development | ||
HYPERBOLIC_GRANULAR_LOG=true # optional, for detailed logging | ||
HYPERBOLIC_LOG_LEVEL=debug # optional, to control the level | ||
HYPERBOLIC_SPASH=true # to show the splash | ||
``` | ||
|
||
## Response Format | ||
|
||
All actions return structured responses with: | ||
- Success/failure status | ||
- Detailed error messages when applicable | ||
- Formatted text output | ||
- Additional data specific to each action | ||
|
||
## Error Handling | ||
|
||
The plugin includes comprehensive error handling for: | ||
- Invalid API keys | ||
- Network issues | ||
- Invalid input formats | ||
- API rate limits | ||
- Server errors | ||
|
||
## Logging | ||
|
||
Granular logging is available by setting `HYPERBOLIC_GRANULAR_LOG=true`. This provides detailed information about: | ||
- API requests and responses | ||
- Validation steps | ||
- Error details | ||
- Action execution flow | ||
|
||
## Development | ||
|
||
To extend or modify this plugin: | ||
|
||
1. All actions are in the `src/actions` directory | ||
2. Utility functions are in `src/utils` | ||
3. Environment configuration is in `src/environment.ts` | ||
4. Error types are in `src/error/base.ts` | ||
|
||
## Dependencies | ||
|
||
- @elizaos/core | ||
- axios | ||
- chalk (for console output) | ||
- cli-table3 (for formatted tables) | ||
- ora (for loading spinners) | ||
|
||
## License | ||
|
||
MIT License |
Oops, something went wrong.