{"_id":"@elizaos/plugin-vercel-ai-gateway-root","_rev":"4-3319bb4e34b47eda8e21f75d2dd431a2","name":"@elizaos/plugin-vercel-ai-gateway-root","dist-tags":{"next":"2.0.0-alpha.1","latest":"2.0.0-alpha.1"},"versions":{"2.0.0-alpha.1":{"name":"@elizaos/plugin-vercel-ai-gateway-root","version":"2.0.0-alpha.1","keywords":[],"author":{"name":"elizaOS"},"license":"MIT","_id":"@elizaos/plugin-vercel-ai-gateway-root@2.0.0-alpha.1","maintainers":[{"name":"shawticus","email":"shawmakesmagic@gmail.com"},{"name":"shakkernerd","email":"shakkerdroid@gmail.com"},{"name":"wtfsayo","email":"hi@sayo.wtf"},{"name":"odilitime","email":"janesmith@airmail.cc"},{"name":"cjft","email":"cjft@trimboli.io"}],"homepage":"https://github.com/elizaos-plugins/plugin-vercel-ai-gateway#readme","bugs":{"url":"https://github.com/elizaos-plugins/plugin-vercel-ai-gateway/issues"},"dist":{"shasum":"43f34ea61cad0c0eec390b40951fd14618e9375f","tarball":"https://registry.npmjs.org/@elizaos/plugin-vercel-ai-gateway-root/-/plugin-vercel-ai-gateway-root-2.0.0-alpha.1.tgz","fileCount":56,"integrity":"sha512-7iX0mFxVEib8s/ppdysZVDPcbltaaeu48Z335seJHkzYyHQ1oTFSLxQ8ajhPW0LPYaMA4ZK/nFyAseAXAPUhgA==","signatures":[{"sig":"MEYCIQC22LBwIsc68NwV3mOYproN/VFlE5TvsJtcEp2CgqkxTAIhAMO2kIkF91yJ+0TXUKC5XEKb2Ht6eigsUqShOut/pKOG","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":876828},"main":"typescript/dist/index.js","type":"module","types":"typescript/dist/index.d.ts","exports":{".":{"types":"./typescript/dist/index.d.ts","import":"./typescript/dist/index.js","default":"./typescript/dist/index.js"},"./rust":{"import":"./rust/pkg/node/elizaos_plugin_plugin_vercel_ai_gateway.js"},"./package.json":"./package.json"},"gitHead":"05d4ca11d769db8c7f54a722ee24b2ce2b951543","scripts":{"dev":"cd typescript && bun --hot build.ts","lint":"bunx @biomejs/biome check --write ./typescript","test":"bun run test:ts && bun run test:rust && bun run test:python","build":"bun run build:ts && bun run build:rust && bun run build:python","clean":"rm -rf typescript/dist python/dist rust/target .turbo node_modules","test:ts":"cd typescript && vitest run || echo 'TypeScript tests skipped - no tests found'","build:ts":"cd typescript && bun run build.ts","lint:rust":"test -d rust && cd rust && cargo clippy --all-targets --fix --allow-dirty --allow-staged -- -D warnings && cargo fmt || echo 'Rust lint skipped'","test:rust":"test -d rust && cd rust && cargo test || echo 'Rust tests skipped'","typecheck":"tsc --noEmit -p typescript/tsconfig.json","build:rust":"test -d rust && cd rust && cargo build --release || echo 'Rust build skipped - no rust directory'","lint:check":"bunx @biomejs/biome check ./typescript","lint:python":"test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint skipped'","test:python":"test -d python && cd python && pytest -p no:anchorpy --asyncio-mode=auto || echo 'Python tests skipped'","build:python":"test -d python && cd python && (python3 -m build 2>/dev/null || pyproject-build) || echo 'Python build skipped - no python directory'","lint:python:fix":"test -d python && cd python && ruff check --fix . && ruff format . || echo 'Python lint fix skipped'"},"_npmUser":{"name":"shawticus","email":"shawmakesmagic@gmail.com"},"repository":{"url":"git+https://github.com/elizaos-plugins/plugin-vercel-ai-gateway.git","type":"git"},"_npmVersion":"lerna/9.0.3/node@v22.20.0+arm64 (darwin)","agentConfig":{"pluginType":"elizaos:plugin:1.0.0","pluginParameters":{"AIGATEWAY_API_KEY":{"type":"string","required":false,"sensitive":true,"description":"Alternate env var for AI Gateway API key."},"VERCEL_OIDC_TOKEN":{"type":"string","required":false,"sensitive":true,"description":"OIDC token for Vercel (used as Bearer auth for Gateway)."},"AI_GATEWAY_API_KEY":{"type":"string","required":false,"sensitive":true,"description":"API key for Vercel AI Gateway (OpenAI-compatible endpoints)."},"AI_GATEWAY_BASE_URL":{"type":"string","default":"https://ai-gateway.vercel.sh/v1","required":false,"sensitive":false,"description":"Base URL for AI Gateway OpenAI-compatible API."},"AI_GATEWAY_TIMEOUT_MS":{"type":"number","default":60000,"required":false,"sensitive":false,"description":"Request timeout in milliseconds."},"AI_GATEWAY_IMAGE_MODEL":{"type":"string","default":"dall-e-3","required":false,"sensitive":false,"description":"Identifier of the model used for image generation."},"AI_GATEWAY_LARGE_MODEL":{"type":"string","default":"gpt-5","required":false,"sensitive":false,"description":"Identifier of the large language model to be used."},"AI_GATEWAY_SMALL_MODEL":{"type":"string","default":"gpt-5-mini","required":false,"sensitive":false,"description":"Identifier of the small language model to be used."},"AI_GATEWAY_EMBEDDING_MODEL":{"type":"string","default":"text-embedding-3-small","required":false,"sensitive":false,"description":"Identifier of the model to use for generating text embeddings."},"AI_GATEWAY_EMBEDDING_DIMENSIONS":{"type":"number","default":1536,"required":false,"sensitive":false,"description":"Number of dimensions for the returned embedding vectors."}}},"description":"Vercel AI Gateway plugin for elizaOS. Provides access to AI models through the Vercel AI Gateway with zero markup.","directories":{},"_nodeVersion":"22.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.5","typescript":"^5.9.3","@types/node":"^25.0.3","@biomejs/biome":"^2.3.11"},"peerDependencies":{"@elizaos/core":"2.0.0-alpha.1"},"_npmOperationalInternal":{"tmp":"tmp/plugin-vercel-ai-gateway-root_2.0.0-alpha.1_1769034254573_0.13272676133445205","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-01-21T22:24:14.457Z","modified":"2026-06-16T05:15:24.900Z","2.0.0-alpha.1":"2026-01-21T22:24:14.788Z"},"bugs":{"url":"https://github.com/elizaos-plugins/plugin-vercel-ai-gateway/issues"},"author":{"name":"elizaOS"},"license":"MIT","homepage":"https://github.com/elizaos-plugins/plugin-vercel-ai-gateway#readme","keywords":[],"repository":{"url":"git+https://github.com/elizaos-plugins/plugin-vercel-ai-gateway.git","type":"git"},"description":"Vercel AI Gateway plugin for elizaOS. Provides access to AI models through the Vercel AI Gateway with zero markup.","maintainers":[{"email":"shawmakesmagic@gmail.com","name":"shawticus"},{"email":"janesmith@airmail.cc","name":"odilitime"}],"readme":"# @elizaos/plugin-gateway\n\nVercel AI Gateway plugin for elizaOS. Provides access to AI models through the Vercel AI Gateway with zero markup.\n\n## Features\n\n- **Text Generation**: `TEXT_SMALL`, `TEXT_LARGE` chat completions\n- **Embeddings**: Vector embeddings generation\n- **Images**: Image generation and description\n- **Structured Output**: JSON object generation\n- **Streaming**: Real-time streaming support\n\n## Multi-Language Support\n\nThis plugin is available in three languages with full feature parity:\n\n| Language   | Directory     | Package Name              |\n| ---------- | ------------- | ------------------------- |\n| TypeScript | `typescript/` | `@elizaos/plugin-gateway` |\n| Python     | `python/`     | `elizaos-plugin-gateway`  |\n| Rust       | `rust/`       | `elizaos-plugin-gateway`  |\n\n## Installation\n\n### TypeScript\n\n```bash\nnpm install @elizaos/plugin-gateway\n# or\nbun add @elizaos/plugin-gateway\n```\n\n### Python\n\n```bash\npip install elizaos-plugin-gateway\n```\n\n### Rust\n\n```toml\n[dependencies]\nelizaos-plugin-gateway = \"1.0\"\n```\n\n## Quick Start\n\n### TypeScript\n\n```typescript\nimport { gatewayPlugin } from \"@elizaos/plugin-gateway\";\nimport { createAgent } from \"@elizaos/core\";\n\nconst agent = createAgent({\n  plugins: [gatewayPlugin],\n});\n\n// Use via runtime\nconst text = await runtime.useModel(ModelType.TEXT_LARGE, {\n  prompt: \"What is quantum computing?\",\n});\n```\n\n### Python\n\n```python\nfrom elizaos_plugin_gateway import GatewayPlugin\n\nasync with GatewayPlugin() as plugin:\n    response = await plugin.generate_text_large(\"What is quantum computing?\")\n    print(response)\n```\n\n### Rust\n\n```rust\nuse elizaos_plugin_gateway::{get_gateway_plugin, TextGenerationParams};\nuse futures::StreamExt;\n\nlet plugin = get_gateway_plugin()?;\n\n// Standard text generation\nlet response = plugin.generate_text(\"What is quantum computing?\").await?;\nprintln!(\"{}\", response);\n\n// Streaming text generation\nlet params = TextGenerationParams::new(\"Tell me a story\");\nlet mut stream = plugin.stream_text(&params).await?;\nwhile let Some(chunk) = stream.next().await {\n    print!(\"{}\", chunk?);\n}\n```\n\n## Configuration\n\nSet environment variables:\n\n```bash\n# Required - one of:\nexport AI_GATEWAY_API_KEY=\"your-api-key\"\nexport AIGATEWAY_API_KEY=\"your-api-key\"\nexport VERCEL_OIDC_TOKEN=\"your-oidc-token\"\n\n# Optional\nexport AI_GATEWAY_BASE_URL=\"https://ai-gateway.vercel.sh/v1\"\nexport AI_GATEWAY_SMALL_MODEL=\"gpt-5-mini\"\nexport AI_GATEWAY_LARGE_MODEL=\"gpt-5\"\nexport AI_GATEWAY_EMBEDDING_MODEL=\"text-embedding-3-small\"\nexport AI_GATEWAY_EMBEDDING_DIMENSIONS=\"1536\"\nexport AI_GATEWAY_IMAGE_MODEL=\"dall-e-3\"\n```\n\n## Supported Model Types\n\n| Model Type          | Description                     |\n| ------------------- | ------------------------------- |\n| `TEXT_SMALL`        | Fast, efficient text generation |\n| `TEXT_LARGE`        | High-quality text generation    |\n| `TEXT_EMBEDDING`    | Vector embeddings               |\n| `OBJECT_SMALL`      | JSON generation (small model)   |\n| `OBJECT_LARGE`      | JSON generation (large model)   |\n| `IMAGE`             | Image generation                |\n| `IMAGE_DESCRIPTION` | Image analysis                  |\n\n## Development\n\n### Build All\n\n```bash\n# TypeScript\nbun run build:ts\n\n# Python\nbun run build:python\n\n# Rust\nbun run build:rust\n```\n\n### Test All\n\n```bash\n# TypeScript\nbun run test:ts\n\n# Python\nbun run test:python\n\n# Rust\nbun run test:rust\n```\n\n### Lint\n\n```bash\nbun run lint\n```\n\n## Architecture\n\n```\nplugin-vercel-ai-gateway/\n├── typescript/          # TypeScript implementation\n│   ├── index.ts        # Main plugin export\n│   ├── types/          # Type definitions\n│   ├── models/         # Model handlers\n│   ├── providers/      # HTTP client\n│   └── utils/          # Configuration utilities\n├── python/             # Python implementation\n│   ├── elizaos_plugin_gateway/\n│   │   ├── __init__.py\n│   │   ├── client.py   # HTTP client\n│   │   ├── config.py   # Configuration\n│   │   ├── plugin.py   # Plugin class\n│   │   └── types.py    # Type definitions\n│   └── tests/\n└── rust/               # Rust implementation\n    ├── src/\n    │   ├── lib.rs      # Main export\n    │   ├── client.rs   # HTTP client\n    │   ├── config.rs   # Configuration\n    │   ├── error.rs    # Error types\n    │   └── types.rs    # Type definitions\n    └── tests/\n```\n\n## License\n\nMIT\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch: `git checkout -b feature/amazing-feature`\n3. Commit your changes: `git commit -m 'Add amazing feature'`\n4. Push to the branch: `git push origin feature/amazing-feature`\n5. Open a Pull Request\n\nPlease ensure all three language implementations maintain parity.\n","readmeFilename":"README.md"}