Skip to content

fix: resolve n8n package workspace dependency issue (v0.4.1)#64

Merged
saschabuehrle merged 5 commits intomainfrom
fix/n8n-workspace-dependency-v0.4.1
Nov 7, 2025
Merged

fix: resolve n8n package workspace dependency issue (v0.4.1)#64
saschabuehrle merged 5 commits intomainfrom
fix/n8n-workspace-dependency-v0.4.1

Conversation

@saschabuehrle
Copy link
Copy Markdown
Collaborator

Summary

This PR fixes the EUNSUPPORTEDPROTOCOL error that prevented users from installing @cascadeflow/n8n-nodes-cascadeflow from npm.

Changes

  • Updated n8n package version: 0.4.0 → 0.4.1
  • Fixed GitHub workflow: Changed from npm publish to pnpm publish for n8n package
  • pnpm automatically converts workspace:* dependencies to actual versions during publish

Problem

The n8n package had "@cascadeflow/core": "workspace:*" in its dependencies. When published with npm publish, this workspace protocol was included in the published package, causing npm to fail when users tried to install it:

npm error Unsupported URL Type "workspace:": workspace:*

Solution

Using pnpm publish instead of npm publish automatically converts workspace dependencies to their actual versions (e.g., workspace:*^0.4.0) during the publish process.

Verification

The package has been published to npm and verified:

  • ✅ Version 0.4.1 is live on npm
  • ✅ Dependencies correctly show @cascadeflow/core: ^0.4.0 (not workspace:*)
  • ✅ Package can be installed without errors

Impact

  • Only affects n8n package publishing workflow
  • No impact on local development (still uses workspace:*)
  • No changes to core/ml packages
  • Future releases will use the corrected workflow

Add comprehensive documentation and examples for running draft and verifier
models on separate Ollama or vLLM instances. This enables optimal GPU
utilization in multi-GPU systems and distributed deployments.

Changes:
- Update .env.example with multi-instance configuration sections
  - OLLAMA_DRAFT_URL and OLLAMA_VERIFIER_URL
  - VLLM_DRAFT_URL and VLLM_VERIFIER_URL
  - References to TypeScript, Python, and Docker examples

- Add TypeScript examples
  - multi-instance-ollama.ts: Three configuration scenarios with health checks
  - multi-instance-vllm.ts: vLLM-specific features and API key support

- Add Python examples
  - multi_instance_ollama.py: Async implementation with health checks
  - multi_instance_vllm.py: Includes PagedAttention and batching notes

- Add Docker Compose setup for multi-GPU deployment
  - GPU device assignment (draft on GPU 0, verifier on GPU 1)
  - Separate ports (11434 and 11435)
  - Health checks and volume isolation
  - Comprehensive README with troubleshooting

Note: Multi-instance support already exists via ModelConfig.baseUrl.
This commit adds documentation and examples for the existing feature.
- Add Multi-Instance Ollama and vLLM to advanced examples tables in main README
  - Python advanced examples section (lines 402-403)
  - TypeScript advanced examples section (lines 439-440)

- Update examples/README.md with comprehensive documentation
  - Add examples to 'Find by Feature' quick reference
  - Update table of contents (3 examples instead of 1)
  - Add detailed sections for both multi-instance examples
  - Include Docker Compose guide references
  - Document use cases, hardware requirements, and performance benefits

All documentation now consistently references the new multi-instance examples.
- Remove invalid quality_threshold parameter from CascadeAgent
- Add quality_threshold to ModelConfig (0.7 for draft, 0.95 for verifier)
- Remove non-existent usage attribute access
- Match cascade setup from basic_usage.py
BREAKING BUG FIX: VLLMProvider and other providers now respect
ModelConfig.base_url for multi-instance deployments.

Problem:
- Providers were instantiated once per provider type, ignoring
  ModelConfig.base_url and api_key parameters
- Multi-instance setups (draft on GPU 0, verifier on GPU 1) failed
  because both models tried to use the same provider instance
- Examples: multi_instance_vllm.py and multi_instance_ollama.py
  couldn't connect to separate instance URLs

Solution:
- CascadeAgent._init_providers() now creates separate provider
  instances for each model with model-specific base_url/api_key
- Added model_providers dict mapping model.name → provider instance
- WholeResponseCascade and CascadeAgent use _get_provider() helper
  to look up model-specific providers (with backwards compat fallback)
- Maintains full backwards compatibility for single-instance setups

Backwards Compatibility:
✅ Tested with basic_usage.py (OpenAI standard setup)
✅ All existing functionality preserved
✅ Only activates when ModelConfig.base_url is set
✅ Falls back to provider-type lookup for existing code

Files Changed:
- cascadeflow/agent.py: _init_providers(), _get_provider(), all
  direct routing methods (_execute_direct_with_timing, etc.)
- cascadeflow/core/cascade.py: __init__(), _get_provider(),
  _call_drafter(), _call_verifier()

Tested:
- ✅ multi_instance_vllm.py with DeepSeek-R1-7B and R1-32B on
  separate instances (192.168.0.199:8000 and :8001)
- ✅ basic_usage.py with OpenAI (standard single-instance)
- ✅ Cascade routing works correctly
- ✅ Direct routing works correctly
- ✅ Health checks pass for both instances
- Update n8n package version from 0.4.0 to 0.4.1
- Fix GitHub workflow to use pnpm publish for n8n package
- pnpm automatically converts workspace:* to actual version during publish
- Resolves npm EUNSUPPORTEDPROTOCOL error when installing the package

Fixes the issue where npm couldn't install @cascadeflow/n8n-nodes-cascadeflow
because it contained workspace:* protocol in dependencies.
@saschabuehrle saschabuehrle merged commit 7617993 into main Nov 7, 2025
15 of 19 checks passed
@saschabuehrle saschabuehrle deleted the fix/n8n-workspace-dependency-v0.4.1 branch November 7, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant