remotemedia-client 0.2.0__tar.gz

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 (171) hide show
  1. remotemedia_client-0.2.0/PKG-INFO +629 -0
  2. remotemedia_client-0.2.0/README.md +554 -0
  3. remotemedia_client-0.2.0/remotemedia/__init__.py +178 -0
  4. remotemedia_client-0.2.0/remotemedia/_vendor/__init__.py +1 -0
  5. remotemedia_client-0.2.0/remotemedia/_vendor/mossttsrealtime/__init__.py +31 -0
  6. remotemedia_client-0.2.0/remotemedia/_vendor/mossttsrealtime/configuration_mossttsrealtime.py +115 -0
  7. remotemedia_client-0.2.0/remotemedia/_vendor/mossttsrealtime/modeling_mossttsrealtime.py +190 -0
  8. remotemedia_client-0.2.0/remotemedia/_vendor/mossttsrealtime/modeling_mossttsrealtime_local.py +471 -0
  9. remotemedia_client-0.2.0/remotemedia/_vendor/mossttsrealtime/processing_mossttsrealtime.py +179 -0
  10. remotemedia_client-0.2.0/remotemedia/_vendor/mossttsrealtime/streaming_mossttsrealtime.py +1051 -0
  11. remotemedia_client-0.2.0/remotemedia/cli.py +106 -0
  12. remotemedia_client-0.2.0/remotemedia/control/__init__.py +68 -0
  13. remotemedia_client-0.2.0/remotemedia/control/client.py +342 -0
  14. remotemedia_client-0.2.0/remotemedia/control/data.py +198 -0
  15. remotemedia_client-0.2.0/remotemedia/control/errors.py +71 -0
  16. remotemedia_client-0.2.0/remotemedia/control/rpc_proxy.py +427 -0
  17. remotemedia_client-0.2.0/remotemedia/control/tests/__init__.py +0 -0
  18. remotemedia_client-0.2.0/remotemedia/control/tests/test_data.py +89 -0
  19. remotemedia_client-0.2.0/remotemedia/control/tests/test_inproc.py +213 -0
  20. remotemedia_client-0.2.0/remotemedia/control/tests/test_pipeline_initialize.py +68 -0
  21. remotemedia_client-0.2.0/remotemedia/control/tests/test_rpc_dispatch.py +458 -0
  22. remotemedia_client-0.2.0/remotemedia/control/tests/test_rpc_proxy.py +279 -0
  23. remotemedia_client-0.2.0/remotemedia/control/tests/test_transport_split.py +40 -0
  24. remotemedia_client-0.2.0/remotemedia/control/transport.py +480 -0
  25. remotemedia_client-0.2.0/remotemedia/core/__init__.py +36 -0
  26. remotemedia_client-0.2.0/remotemedia/core/exceptions.py +41 -0
  27. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/__init__.py +497 -0
  28. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/__main__.py +4 -0
  29. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/audio_pressure.py +220 -0
  30. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/channel.py +191 -0
  31. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/data.py +749 -0
  32. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/node.py +1691 -0
  33. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/pipeline.py +504 -0
  34. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/runner.py +651 -0
  35. remotemedia_client-0.2.0/remotemedia/core/multiprocessing/session.py +281 -0
  36. remotemedia_client-0.2.0/remotemedia/core/node.py +674 -0
  37. remotemedia_client-0.2.0/remotemedia/core/node_serialization.py +248 -0
  38. remotemedia_client-0.2.0/remotemedia/core/pipeline.py +868 -0
  39. remotemedia_client-0.2.0/remotemedia/core/pipeline_registry.py +681 -0
  40. remotemedia_client-0.2.0/remotemedia/core/types.py +6 -0
  41. remotemedia_client-0.2.0/remotemedia/data/__init__.py +9 -0
  42. remotemedia_client-0.2.0/remotemedia/data/video.py +146 -0
  43. remotemedia_client-0.2.0/remotemedia/examples/__init__.py +0 -0
  44. remotemedia_client-0.2.0/remotemedia/examples/objects.py +101 -0
  45. remotemedia_client-0.2.0/remotemedia/examples/test_classes.py +37 -0
  46. remotemedia_client-0.2.0/remotemedia/examples/test_method_types.py +192 -0
  47. remotemedia_client-0.2.0/remotemedia/nodes/__init__.py +201 -0
  48. remotemedia_client-0.2.0/remotemedia/nodes/affect/__init__.py +15 -0
  49. remotemedia_client-0.2.0/remotemedia/nodes/affect/prosody_vad.py +260 -0
  50. remotemedia_client-0.2.0/remotemedia/nodes/affect/prosody_vad_node.py +352 -0
  51. remotemedia_client-0.2.0/remotemedia/nodes/audio.py +967 -0
  52. remotemedia_client-0.2.0/remotemedia/nodes/base.py +104 -0
  53. remotemedia_client-0.2.0/remotemedia/nodes/calculator.py +143 -0
  54. remotemedia_client-0.2.0/remotemedia/nodes/code_executor.py +271 -0
  55. remotemedia_client-0.2.0/remotemedia/nodes/custom.py +40 -0
  56. remotemedia_client-0.2.0/remotemedia/nodes/grpc_source.py +261 -0
  57. remotemedia_client-0.2.0/remotemedia/nodes/io_nodes.py +460 -0
  58. remotemedia_client-0.2.0/remotemedia/nodes/kimodo_motion.py +1067 -0
  59. remotemedia_client-0.2.0/remotemedia/nodes/lerobot_so101.py +639 -0
  60. remotemedia_client-0.2.0/remotemedia/nodes/loader.py +496 -0
  61. remotemedia_client-0.2.0/remotemedia/nodes/ml/__init__.py +79 -0
  62. remotemedia_client-0.2.0/remotemedia/nodes/ml/activation_tap.py +297 -0
  63. remotemedia_client-0.2.0/remotemedia/nodes/ml/lfm2_audio.py +1391 -0
  64. remotemedia_client-0.2.0/remotemedia/nodes/ml/lfm2_audio_mlx.py +1082 -0
  65. remotemedia_client-0.2.0/remotemedia/nodes/ml/lfm2_demo_agent.py +746 -0
  66. remotemedia_client-0.2.0/remotemedia/nodes/ml/lfm2_instruct_agent.py +1697 -0
  67. remotemedia_client-0.2.0/remotemedia/nodes/ml/lfm2_text.py +364 -0
  68. remotemedia_client-0.2.0/remotemedia/nodes/ml/mlx_lm_text.py +736 -0
  69. remotemedia_client-0.2.0/remotemedia/nodes/ml/moss_audio.py +794 -0
  70. remotemedia_client-0.2.0/remotemedia/nodes/ml/moss_tts.py +954 -0
  71. remotemedia_client-0.2.0/remotemedia/nodes/ml/moss_tts_realtime.py +1154 -0
  72. remotemedia_client-0.2.0/remotemedia/nodes/ml/parakeet_eou.py +350 -0
  73. remotemedia_client-0.2.0/remotemedia/nodes/ml/personaplex_audio_mlx.py +920 -0
  74. remotemedia_client-0.2.0/remotemedia/nodes/ml/qwen.py +264 -0
  75. remotemedia_client-0.2.0/remotemedia/nodes/ml/qwen_text_mlx.py +2171 -0
  76. remotemedia_client-0.2.0/remotemedia/nodes/ml/qwen_tts_mlx.py +605 -0
  77. remotemedia_client-0.2.0/remotemedia/nodes/ml/tool_classifier.py +444 -0
  78. remotemedia_client-0.2.0/remotemedia/nodes/ml/tool_observer.py +414 -0
  79. remotemedia_client-0.2.0/remotemedia/nodes/ml/transformers_pipeline.py +427 -0
  80. remotemedia_client-0.2.0/remotemedia/nodes/ml/ultravox.py +651 -0
  81. remotemedia_client-0.2.0/remotemedia/nodes/ml/whisper_stt.py +319 -0
  82. remotemedia_client-0.2.0/remotemedia/nodes/ml/whisper_transcription.py +445 -0
  83. remotemedia_client-0.2.0/remotemedia/nodes/multiprocess_test_nodes.py +130 -0
  84. remotemedia_client-0.2.0/remotemedia/nodes/omniasr/__init__.py +35 -0
  85. remotemedia_client-0.2.0/remotemedia/nodes/registration.py +317 -0
  86. remotemedia_client-0.2.0/remotemedia/nodes/remote.py +178 -0
  87. remotemedia_client-0.2.0/remotemedia/nodes/serialized_class_executor.py +198 -0
  88. remotemedia_client-0.2.0/remotemedia/nodes/simple_math.py +38 -0
  89. remotemedia_client-0.2.0/remotemedia/nodes/simple_pytorch_test.py +122 -0
  90. remotemedia_client-0.2.0/remotemedia/nodes/sink.py +157 -0
  91. remotemedia_client-0.2.0/remotemedia/nodes/source.py +320 -0
  92. remotemedia_client-0.2.0/remotemedia/nodes/test_echo.py +96 -0
  93. remotemedia_client-0.2.0/remotemedia/nodes/test_nodes.py +269 -0
  94. remotemedia_client-0.2.0/remotemedia/nodes/text_collector.py +246 -0
  95. remotemedia_client-0.2.0/remotemedia/nodes/text_processor.py +130 -0
  96. remotemedia_client-0.2.0/remotemedia/nodes/transcription.py +247 -0
  97. remotemedia_client-0.2.0/remotemedia/nodes/transform.py +128 -0
  98. remotemedia_client-0.2.0/remotemedia/nodes/tts.py +746 -0
  99. remotemedia_client-0.2.0/remotemedia/nodes/tts_cosyvoice3.py +416 -0
  100. remotemedia_client-0.2.0/remotemedia/nodes/tts_vibevoice.py +522 -0
  101. remotemedia_client-0.2.0/remotemedia/nodes/tts_voxtral.py +360 -0
  102. remotemedia_client-0.2.0/remotemedia/nodes/video.py +111 -0
  103. remotemedia_client-0.2.0/remotemedia/packaging/__init__.py +11 -0
  104. remotemedia_client-0.2.0/remotemedia/packaging/code_packager.py +317 -0
  105. remotemedia_client-0.2.0/remotemedia/packaging/dependency_analyzer.py +233 -0
  106. remotemedia_client-0.2.0/remotemedia/persistence/__init__.py +28 -0
  107. remotemedia_client-0.2.0/remotemedia/persistence/database.py +295 -0
  108. remotemedia_client-0.2.0/remotemedia/persistence/migrations.py +205 -0
  109. remotemedia_client-0.2.0/remotemedia/persistence/models.py +182 -0
  110. remotemedia_client-0.2.0/remotemedia/persistence/node_store.py +475 -0
  111. remotemedia_client-0.2.0/remotemedia/persistence/pipeline_store.py +550 -0
  112. remotemedia_client-0.2.0/remotemedia/protos/__init__.py +37 -0
  113. remotemedia_client-0.2.0/remotemedia/protos/common_pb2.py +100 -0
  114. remotemedia_client-0.2.0/remotemedia/protos/common_pb2_grpc.py +24 -0
  115. remotemedia_client-0.2.0/remotemedia/protos/control_pb2.py +83 -0
  116. remotemedia_client-0.2.0/remotemedia/protos/control_pb2_grpc.py +112 -0
  117. remotemedia_client-0.2.0/remotemedia/protos/execution.proto +578 -0
  118. remotemedia_client-0.2.0/remotemedia/protos/execution_pb2.py +227 -0
  119. remotemedia_client-0.2.0/remotemedia/protos/execution_pb2_grpc.py +1104 -0
  120. remotemedia_client-0.2.0/remotemedia/protos/types.proto +115 -0
  121. remotemedia_client-0.2.0/remotemedia/protos/types_pb2.py +66 -0
  122. remotemedia_client-0.2.0/remotemedia/protos/types_pb2_grpc.py +24 -0
  123. remotemedia_client-0.2.0/remotemedia/remote/__init__.py +8 -0
  124. remotemedia_client-0.2.0/remotemedia/remote/client.py +696 -0
  125. remotemedia_client-0.2.0/remotemedia/remote/generator_proxy.py +182 -0
  126. remotemedia_client-0.2.0/remotemedia/remote/proxy_client.py +265 -0
  127. remotemedia_client-0.2.0/remotemedia/remote/proxy_enhanced.py +268 -0
  128. remotemedia_client-0.2.0/remotemedia/remote/streaming_methods.py +213 -0
  129. remotemedia_client-0.2.0/remotemedia/remote/streaming_proxy.py +300 -0
  130. remotemedia_client-0.2.0/remotemedia/rpc.py +72 -0
  131. remotemedia_client-0.2.0/remotemedia/runtime_wrapper.py +406 -0
  132. remotemedia_client-0.2.0/remotemedia/serialization/__init__.py +7 -0
  133. remotemedia_client-0.2.0/remotemedia/serialization/base.py +60 -0
  134. remotemedia_client-0.2.0/remotemedia/tests/__init__.py +0 -0
  135. remotemedia_client-0.2.0/remotemedia/tests/test_rpc_decorator.py +119 -0
  136. remotemedia_client-0.2.0/remotemedia/utils/__init__.py +7 -0
  137. remotemedia_client-0.2.0/remotemedia/utils/logging.py +41 -0
  138. remotemedia_client-0.2.0/remotemedia/utils/test_objects.py +26 -0
  139. remotemedia_client-0.2.0/remotemedia/webrtc/__init__.py +43 -0
  140. remotemedia_client-0.2.0/remotemedia/webrtc/manager.py +87 -0
  141. remotemedia_client-0.2.0/remotemedia/webrtc/pipeline_processor.py +742 -0
  142. remotemedia_client-0.2.0/remotemedia/webrtc/server.py +518 -0
  143. remotemedia_client-0.2.0/remotemedia_client.egg-info/PKG-INFO +629 -0
  144. remotemedia_client-0.2.0/remotemedia_client.egg-info/SOURCES.txt +169 -0
  145. remotemedia_client-0.2.0/remotemedia_client.egg-info/dependency_links.txt +1 -0
  146. remotemedia_client-0.2.0/remotemedia_client.egg-info/entry_points.txt +2 -0
  147. remotemedia_client-0.2.0/remotemedia_client.egg-info/not-zip-safe +1 -0
  148. remotemedia_client-0.2.0/remotemedia_client.egg-info/requires.txt +48 -0
  149. remotemedia_client-0.2.0/remotemedia_client.egg-info/top_level.txt +1 -0
  150. remotemedia_client-0.2.0/setup.cfg +4 -0
  151. remotemedia_client-0.2.0/setup.py +100 -0
  152. remotemedia_client-0.2.0/tests/test_activation_tap.py +215 -0
  153. remotemedia_client-0.2.0/tests/test_control_bus_grpc.py +209 -0
  154. remotemedia_client-0.2.0/tests/test_instance_pipelines.py +360 -0
  155. remotemedia_client-0.2.0/tests/test_lfm2_audio_blip_detection.py +287 -0
  156. remotemedia_client-0.2.0/tests/test_lfm2_audio_blip_end_to_end.py +328 -0
  157. remotemedia_client-0.2.0/tests/test_lfm2_control_bus_e2e.py +203 -0
  158. remotemedia_client-0.2.0/tests/test_lfm2_multi_turn_control.py +349 -0
  159. remotemedia_client-0.2.0/tests/test_managed_execution.py +80 -0
  160. remotemedia_client-0.2.0/tests/test_managed_execution_rust.py +78 -0
  161. remotemedia_client-0.2.0/tests/test_manifest_serialization.py +328 -0
  162. remotemedia_client-0.2.0/tests/test_parakeet_eou_offline.py +189 -0
  163. remotemedia_client-0.2.0/tests/test_parent_death_watcher.py +232 -0
  164. remotemedia_client-0.2.0/tests/test_pep723_node_requirements.py +44 -0
  165. remotemedia_client-0.2.0/tests/test_qwen_text_mlx_multi_turn.py +1315 -0
  166. remotemedia_client-0.2.0/tests/test_qwen_tts_mlx_multi_turn.py +461 -0
  167. remotemedia_client-0.2.0/tests/test_runtime_data_file.py +247 -0
  168. remotemedia_client-0.2.0/tests/test_rust_compatibility.py +350 -0
  169. remotemedia_client-0.2.0/tests/test_rust_integration.py +121 -0
  170. remotemedia_client-0.2.0/tests/test_tool_classifier_offline.py +265 -0
  171. remotemedia_client-0.2.0/tests/test_us3_serialization.py +335 -0
@@ -0,0 +1,629 @@
1
+ Metadata-Version: 2.4
2
+ Name: remotemedia-client
3
+ Version: 0.2.0
4
+ Summary: A Python SDK for distributed audio/video/data processing with native Rust acceleration (2-16x speedup)
5
+ Home-page: https://github.com/matbeeDOTcom/remotemedia-sdk
6
+ Author: Mathieu Gosbee
7
+ Author-email: mail@matbee.com
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Multimedia :: Sound/Audio
11
+ Classifier: Topic :: Multimedia :: Video
12
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.9
20
+ Description-Content-Type: text/markdown
21
+ Requires-Dist: grpcio>=1.50.0
22
+ Requires-Dist: grpcio-tools>=1.50.0
23
+ Requires-Dist: protobuf>=4.21.0
24
+ Requires-Dist: numpy<3.0,>=1.21.0
25
+ Requires-Dist: av>=14.0.0
26
+ Requires-Dist: cloudpickle>=2.2.0
27
+ Requires-Dist: iceoryx2==0.9.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
30
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
31
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
32
+ Requires-Dist: black>=23.0.0; extra == "dev"
33
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
34
+ Requires-Dist: mypy>=1.0.0; extra == "dev"
35
+ Requires-Dist: pre-commit>=3.0.0; extra == "dev"
36
+ Requires-Dist: sphinx>=6.0.0; extra == "dev"
37
+ Requires-Dist: sphinx-rtd-theme>=1.2.0; extra == "dev"
38
+ Requires-Dist: twine>=4.0.0; extra == "dev"
39
+ Requires-Dist: build>=0.10.0; extra == "dev"
40
+ Provides-Extra: ml
41
+ Requires-Dist: numpy<3.0,>=1.26.0; extra == "ml"
42
+ Requires-Dist: torch>=2.0.0; extra == "ml"
43
+ Requires-Dist: transformers>=4.30.0; extra == "ml"
44
+ Requires-Dist: torchvision>=0.15.0; extra == "ml"
45
+ Requires-Dist: torchaudio>=2.0.0; extra == "ml"
46
+ Requires-Dist: opencv-python>=4.8.0; extra == "ml"
47
+ Requires-Dist: pillow>=10.0.0; extra == "ml"
48
+ Requires-Dist: librosa>=0.10.0; extra == "ml"
49
+ Requires-Dist: scikit-learn>=1.3.0; extra == "ml"
50
+ Requires-Dist: accelerate; extra == "ml"
51
+ Requires-Dist: datasets; extra == "ml"
52
+ Requires-Dist: soundfile; extra == "ml"
53
+ Requires-Dist: peft; extra == "ml"
54
+ Requires-Dist: kokoro>=0.9.0; extra == "ml"
55
+ Requires-Dist: qwen_omni_utils>=0.0.8; extra == "ml"
56
+ Provides-Extra: multiprocess
57
+ Requires-Dist: multiprocessing>=0.70; extra == "multiprocess"
58
+ Requires-Dist: pyarrow>=14.0.0; extra == "multiprocess"
59
+ Requires-Dist: msgpack>=1.0.0; extra == "multiprocess"
60
+ Provides-Extra: omniasr
61
+ Requires-Dist: omnilingual-asr>=0.1.0; extra == "omniasr"
62
+ Requires-Dist: silero-vad>=5.0.0; extra == "omniasr"
63
+ Requires-Dist: torch>=2.0.0; extra == "omniasr"
64
+ Requires-Dist: torchaudio>=2.0.0; extra == "omniasr"
65
+ Dynamic: author
66
+ Dynamic: author-email
67
+ Dynamic: classifier
68
+ Dynamic: description
69
+ Dynamic: description-content-type
70
+ Dynamic: home-page
71
+ Dynamic: provides-extra
72
+ Dynamic: requires-dist
73
+ Dynamic: requires-python
74
+ Dynamic: summary
75
+
76
+ # RemoteMedia Processing SDK
77
+
78
+ A Python SDK for building distributed audio/video/data processing pipelines with transparent remote offloading capabilities.
79
+
80
+ ## Overview
81
+
82
+ The RemoteMedia Processing SDK enables developers to create complex, real-time processing applications that can seamlessly offload computationally intensive tasks to remote execution services. The SDK handles WebRTC communication, data synchronization, and remote execution while providing a transparent and intuitive developer experience.
83
+
84
+ ## Key Features
85
+
86
+ - **Pythonic Pipeline API**: High-level, intuitive API for defining processing pipelines
87
+ - **Transparent Remote Offloading**: Execute processing nodes remotely with minimal code changes
88
+ - **Real-time A/V Processing**: Optimized for low-latency audio/video processing
89
+ - **WebRTC Integration**: Built-in WebRTC support for real-time communication
90
+ - **Flexible Architecture**: Support for both SDK-provided and custom processing nodes
91
+ - **Secure Remote Execution**: Sandboxed execution environment for user-defined code
92
+ - **CloudPickle Integration**: Serialize and execute user-defined Python classes remotely
93
+ - **AST-Based Dependency Analysis**: Automatic detection and packaging of local Python dependencies
94
+ - **Enhanced Code Packaging**: Handles modules from anywhere in the filesystem, not just project directory
95
+ - **Automatic Module Loading**: Pre-loads Python modules on the server for proper deserialization
96
+ - **Pip Package Dependencies**: Automatically install required packages on remote servers
97
+ - **TypeScript/Node.js Support**: Export TypeScript interface definitions for type-safe Node.js integration
98
+ - **Pipeline Export/Import**: Export complete pipeline definitions for cross-language interoperability
99
+ - **JavaScript Pipeline Integration**: Create and execute pipelines from JavaScript/TypeScript clients
100
+ - **Dynamic Pipeline Registry**: Discover and execute registered pipelines via gRPC
101
+
102
+ ## Development Status
103
+
104
+ **Current Phase**: Phase 4 - WebRTC Real-time Audio Processing (COMPLETE) ✅
105
+
106
+ **Phase 4 Achievements:**
107
+ - ✅ **WebRTC Server Integration**: Real-time audio/video streaming with aiortc
108
+ - ✅ **Voice Activity Detection (VAD)**: Speech segmentation with buffering
109
+ - ✅ **Speech-to-Speech Pipeline**: Ultravox STT + Kokoro TTS integration
110
+ - ✅ **Remote Proxy Client**: Transparent remote execution for ANY Python object
111
+
112
+ **Phase 3 Achievements:**
113
+ - ✅ **Remote Python Code Execution**: Full support for executing user-defined Python code remotely
114
+ - ✅ **CloudPickle Class Serialization**: Serialize and execute custom Python classes with state preservation
115
+ - ✅ **AST-Based Dependency Analysis**: Automatic detection of local Python file dependencies
116
+ - ✅ **Code & Dependency Packaging**: Complete packaging system for deployable archives
117
+ - ✅ **Secure Execution Environment**: Sandboxed remote execution with restricted globals
118
+ - ✅ **Comprehensive Testing**: 7/7 test scenarios passing (4 CloudPickle + 3 dependency packaging)
119
+
120
+ **What Works Now:**
121
+ - **NEW**: RemoteProxyClient - Make ANY Python object remote with one line of code
122
+ - WebRTC real-time audio processing with proper frame timing
123
+ - Voice-triggered speech-to-speech conversation system
124
+ - Users can define Python classes locally with custom dependencies
125
+ - AST analysis automatically detects and packages local Python file imports
126
+ - CloudPickle enables serialization of complex user-defined objects
127
+ - Remote execution preserves object state and functionality across network boundaries
128
+ - End-to-end remote code execution with proper error handling and logging
129
+
130
+ See `PHASE_3_PROJECT_TRACKING.md` for detailed status and `DevelopmentStrategyDocument.md` for complete roadmap.
131
+
132
+ ## Quick Start
133
+
134
+ ### Local Processing Pipeline
135
+ ```python
136
+ from remotemedia.core import Pipeline
137
+ from remotemedia.nodes import MediaReaderNode, AudioResampleNode, MediaWriterNode
138
+
139
+ # Create a simple local processing pipeline
140
+ pipeline = Pipeline(
141
+ MediaReaderNode(file_path="input.mp3"),
142
+ AudioResampleNode(target_sample_rate=16000),
143
+ MediaWriterNode(output_path="output.wav")
144
+ )
145
+ pipeline.run()
146
+ ```
147
+
148
+ ### Remote Code Execution
149
+ The SDK makes it simple to define a node locally and have it execute on a remote server. This is ideal for offloading heavy ML workloads.
150
+
151
+ ```python
152
+ # client_script.py
153
+ from remotemedia.core import Pipeline
154
+ from remotemedia.nodes import MediaReaderNode, MediaWriterNode, RemoteObjectExecutionNode
155
+ from my_custom_nodes import AudioEchoEffect # A custom node defined in your project
156
+
157
+ # 1. Instantiate your custom node locally.
158
+ # This object will be serialized and sent to the server for execution.
159
+ echo_effect = AudioEchoEffect(delay_seconds=0.5, decay_factor=0.6)
160
+
161
+ # 2. Wrap it in a RemoteObjectExecutionNode
162
+ remote_echo_node = RemoteObjectExecutionNode(node_object=echo_effect)
163
+
164
+ # 3. Build the pipeline. The remote node fits in just like any other.
165
+ pipeline = Pipeline(
166
+ MediaReaderNode(file_path="input.wav"),
167
+ remote_echo_node,
168
+ MediaWriterNode(output_path="output_with_echo.wav")
169
+ )
170
+
171
+ # When run, the pipeline will transparently execute the echo effect on the remote server.
172
+ pipeline.run()
173
+ ```
174
+
175
+ ### Remote Proxy Client (NEW!)
176
+ The RemoteProxyClient provides the simplest way to execute ANY Python object remotely:
177
+
178
+ ```python
179
+ from remotemedia.remote import RemoteProxyClient
180
+ from remotemedia.core.node import RemoteExecutorConfig
181
+
182
+ # Configure connection
183
+ config = RemoteExecutorConfig(host="localhost", port=50052)
184
+
185
+ async with RemoteProxyClient(config) as client:
186
+ # Make ANY object remote with just ONE line!
187
+ calculator = Calculator()
188
+ remote_calc = await client.create_proxy(calculator)
189
+
190
+ # Use it exactly like a local object (just add await)
191
+ result = await remote_calc.add(5, 3)
192
+ print(f"5 + 3 = {result}") # Executed on remote server!
193
+
194
+ # Keyword arguments work transparently!
195
+ result = await remote_calc.calculate(operation="multiply", a=10, b=4)
196
+
197
+ # The remote object maintains state
198
+ history = await remote_calc.history() # State persists remotely
199
+ ```
200
+
201
+ **With Pip Package Dependencies (NEW!):**
202
+ ```python
203
+ # Specify pip packages that your remote code needs
204
+ config = RemoteExecutorConfig(
205
+ host="localhost",
206
+ port=50052,
207
+ pip_packages=["numpy", "pandas", "scipy", "requests"]
208
+ )
209
+
210
+ async with RemoteProxyClient(config) as client:
211
+ # Your object can now use these packages on the remote server!
212
+ data_processor = DataProcessor()
213
+ remote_processor = await client.create_proxy(data_processor)
214
+
215
+ # The remote server automatically installs packages in a virtual environment
216
+ result = await remote_processor.analyze_with_pandas(data)
217
+ ```
218
+
219
+ **Key Features:**
220
+ - **One-line remote conversion**: `remote_obj = await client.create_proxy(obj)`
221
+ - **Works with ANY Python object**: No special base class required
222
+ - **Transparent usage**: Call methods exactly as you would locally
223
+ - **State persistence**: Objects maintain state on the remote server
224
+ - **Session management**: Automatic session handling with unique IDs
225
+ - **Generator support**: Generators automatically materialized to lists
226
+ - **Property support**: Access properties with `await`
227
+ - **Async method support**: Both sync and async methods work seamlessly
228
+ - **Pip package dependencies**: Automatically install required packages on remote server
229
+
230
+ **Supported Method Types:**
231
+ - ✅ Synchronous methods (automatically wrapped in async)
232
+ - ✅ Asynchronous methods
233
+ - ✅ Generator functions (automatically converted to lists)
234
+ - ✅ Async generator functions (automatically converted to lists)
235
+ - ✅ Properties and attributes (accessed with `await`)
236
+ - ✅ Static methods
237
+ - ✅ Most special methods (`__call__`, `__getitem__`, etc.)
238
+ - ✅ **Keyword arguments** (NEW): Full support for kwargs in all method types
239
+
240
+ **Generator Streaming Support (NEW!):**
241
+ - ✅ **True streaming**: Generators now return proxy objects that fetch items as needed
242
+ - ✅ **Batched fetching**: Configurable batch size for optimal performance (default: 10 items)
243
+ - ✅ **Early termination**: Stop iteration at any time, server resources are freed
244
+ - ✅ **Memory efficient**: Only requested items are generated and transferred
245
+ - ✅ **Automatic cleanup**: Generators are properly closed on completion or error
246
+ - ✅ **Error propagation**: Server-side errors in generators are properly propagated to client
247
+
248
+ Example:
249
+ ```python
250
+ # Generators now stream data instead of materializing to lists!
251
+ async for chunk in await remote_obj.read_large_file("data.bin"):
252
+ process(chunk)
253
+ if should_stop():
254
+ break # Generator properly closed on server
255
+ ```
256
+
257
+ See `examples/test_streaming_generators.py` for comprehensive examples.
258
+
259
+ See `examples/simplest_proxy.py` and `examples/test_transparent_generators.py` for more examples.
260
+
261
+ ### Pipeline Export and JavaScript Integration (NEW!)
262
+
263
+ The SDK now supports exporting complete pipeline definitions that can be discovered, executed, and even created by JavaScript/TypeScript clients:
264
+
265
+ #### Registering Pipelines for Export
266
+
267
+ ```python
268
+ from remotemedia.core import Pipeline
269
+ from remotemedia.core.pipeline_registry import PipelineRegistry
270
+ from remotemedia.nodes import CalculatorNode, PassThroughNode
271
+
272
+ # Create a pipeline
273
+ pipeline = Pipeline(
274
+ name="calculator_pipeline",
275
+ nodes=[
276
+ PassThroughNode(),
277
+ CalculatorNode(),
278
+ PassThroughNode()
279
+ ]
280
+ )
281
+
282
+ # Register it with the global registry
283
+ registry = PipelineRegistry.get_instance()
284
+ pipeline_id = await registry.register_pipeline(
285
+ name="calculator_pipeline",
286
+ pipeline=pipeline,
287
+ metadata={
288
+ "description": "A simple calculator pipeline",
289
+ "version": "1.0.0",
290
+ "author": "Example Author"
291
+ }
292
+ )
293
+
294
+ # Pipeline is now discoverable and executable via gRPC!
295
+ ```
296
+
297
+ #### JavaScript Client Usage
298
+
299
+ ```javascript
300
+ import { PipelineClient } from '@remote_media_processing/nodejs-client';
301
+
302
+ // Connect to the server
303
+ const client = new PipelineClient({
304
+ host: 'localhost',
305
+ port: 50052
306
+ });
307
+
308
+ // Discover available pipelines
309
+ const pipelines = await client.listPipelines();
310
+ console.log('Available pipelines:', pipelines);
311
+
312
+ // Get detailed info about a specific pipeline
313
+ const info = await client.getPipelineInfo('calculator_pipeline');
314
+ console.log('Pipeline nodes:', info.definition.nodes);
315
+
316
+ // Execute a registered pipeline
317
+ const result = await client.executePipeline('calculator_pipeline', {
318
+ operation: 'multiply',
319
+ args: [10, 5]
320
+ });
321
+ console.log('Result:', result); // { result: 50 }
322
+
323
+ // Stream data through a pipeline
324
+ const stream = client.streamPipeline('data_processing_pipeline');
325
+ stream.on('data', (chunk) => console.log('Received:', chunk));
326
+ stream.on('error', (err) => console.error('Error:', err));
327
+ stream.on('end', () => console.log('Stream complete'));
328
+
329
+ // Send data to the pipeline
330
+ await stream.send({ data: 'process this' });
331
+ await stream.end();
332
+ ```
333
+
334
+ #### Creating Pipelines from JavaScript
335
+
336
+ ```javascript
337
+ import { PipelineClient, PipelineBuilder } from '@remote_media_processing/nodejs-client';
338
+
339
+ const client = new PipelineClient({ host: 'localhost', port: 50052 });
340
+
341
+ // Build a pipeline definition in JavaScript
342
+ const builder = new PipelineBuilder('my_js_pipeline');
343
+ builder
344
+ .addNode('DataSourceNode', { buffer_size: 100 })
345
+ .addNode('CalculatorNode', {})
346
+ .addNode('DataSinkNode', { result_key: 'output' })
347
+ .connect(0, 1) // Connect source to calculator
348
+ .connect(1, 2); // Connect calculator to sink
349
+
350
+ // Register the JavaScript-created pipeline on the server
351
+ const pipelineId = await client.registerPipeline(
352
+ 'my_js_pipeline',
353
+ builder.build(),
354
+ {
355
+ metadata: {
356
+ description: 'Pipeline created from JavaScript',
357
+ source: 'nodejs-client'
358
+ }
359
+ }
360
+ );
361
+
362
+ // Now execute it
363
+ const result = await client.executePipeline(pipelineId, {
364
+ operation: 'add',
365
+ args: [3, 7]
366
+ });
367
+ ```
368
+
369
+ #### Bidirectional Data Flow
370
+
371
+ The SDK provides special I/O nodes for JavaScript integration:
372
+
373
+ ```python
374
+ from remotemedia.nodes import DataSourceNode, DataSinkNode, JavaScriptBridgeNode
375
+
376
+ # Create a pipeline with JavaScript I/O points
377
+ pipeline = Pipeline(
378
+ name="js_interactive_pipeline",
379
+ nodes=[
380
+ DataSourceNode(buffer_size=100), # Receives data from JavaScript
381
+ YourProcessingNode(),
382
+ JavaScriptBridgeNode(), # Bidirectional JavaScript communication
383
+ MoreProcessingNode(),
384
+ DataSinkNode(result_key="output") # Sends results to JavaScript
385
+ ]
386
+ )
387
+ ```
388
+
389
+ From JavaScript:
390
+ ```javascript
391
+ // Create a bidirectional stream
392
+ const stream = client.streamPipeline('js_interactive_pipeline', {
393
+ bidirectional: true
394
+ });
395
+
396
+ // Send data and receive processed results
397
+ stream.on('data', (result) => {
398
+ console.log('Processed:', result);
399
+ // Can send more data based on results
400
+ if (result.needsMoreData) {
401
+ stream.send({ moreData: true });
402
+ }
403
+ });
404
+
405
+ stream.send({ initialData: 'start processing' });
406
+ ```
407
+
408
+ #### Pipeline Discovery API
409
+
410
+ ```javascript
411
+ // List all registered pipelines with filtering
412
+ const pipelines = await client.listPipelines({
413
+ filter: {
414
+ tags: ['audio', 'realtime'],
415
+ author: 'team-audio'
416
+ }
417
+ });
418
+
419
+ // Unregister when done
420
+ await client.unregisterPipeline('pipeline_id');
421
+ ```
422
+
423
+ ### TypeScript/Node.js Integration
424
+
425
+ Generate TypeScript interface definitions for type-safe Node.js integration:
426
+
427
+ ```bash
428
+ # Generate TypeScript definitions
429
+ python scripts/generate_typescript_defs.py -o remotemedia-types.d.ts
430
+ ```
431
+
432
+ Use from Node.js/TypeScript:
433
+
434
+ ```typescript
435
+ import { RemoteExecutionClient, NodeType, AudioTransformConfig } from './remotemedia-types';
436
+
437
+ const config: RemoteExecutorConfig = {
438
+ host: 'localhost',
439
+ port: 50052,
440
+ protocol: 'grpc'
441
+ };
442
+
443
+ const client = new RemoteExecutionClient(config);
444
+
445
+ // Execute with full type safety
446
+ const audioConfig: AudioTransformConfig = {
447
+ sampleRate: 16000,
448
+ channels: 1
449
+ };
450
+
451
+ const result = await client.executeNode(
452
+ NodeType.AudioTransform,
453
+ audioConfig,
454
+ audioData
455
+ );
456
+ ```
457
+
458
+ See [TypeScript/Node.js Usage Guide](docs/TYPESCRIPT_USAGE.md) for complete documentation.
459
+
460
+ ### Pip Package Dependencies (NEW!)
461
+
462
+ The SDK now supports automatic installation of pip packages on the remote server:
463
+
464
+ ```python
465
+ from remotemedia.core.node import RemoteExecutorConfig
466
+ from remotemedia.remote import RemoteProxyClient
467
+
468
+ # Specify packages your remote code needs
469
+ config = RemoteExecutorConfig(
470
+ host="localhost",
471
+ port=50052,
472
+ pip_packages=["beautifulsoup4", "requests", "pillow", "matplotlib"]
473
+ )
474
+
475
+ class WebScraper:
476
+ def scrape_images(self, url):
477
+ import requests
478
+ from bs4 import BeautifulSoup
479
+ from PIL import Image
480
+ import io
481
+
482
+ # These imports work because packages are installed remotely!
483
+ response = requests.get(url)
484
+ soup = BeautifulSoup(response.content, 'html.parser')
485
+ # ... process images with PIL ...
486
+
487
+ async with RemoteProxyClient(config) as client:
488
+ scraper = WebScraper()
489
+ remote_scraper = await client.create_proxy(scraper)
490
+
491
+ # Packages are installed automatically in a virtual environment
492
+ images = await remote_scraper.scrape_images("https://example.com")
493
+ ```
494
+
495
+ **Features:**
496
+ - **Automatic installation**: Packages are installed when creating the proxy
497
+ - **Virtual environment isolation**: Each session gets its own virtual environment
498
+ - **Dependency resolution**: Package dependencies are automatically resolved
499
+ - **Error handling**: Clear error messages if packages fail to install
500
+ - **No server restart needed**: Add new packages dynamically per session
501
+
502
+ **Supported packages**: Any pip-installable package including:
503
+ - Scientific computing: `numpy`, `scipy`, `pandas`, `scikit-learn`
504
+ - Web scraping: `beautifulsoup4`, `requests`, `httpx`, `selenium`
505
+ - Image processing: `pillow`, `opencv-python`, `imageio`
506
+ - Machine learning: `torch`, `tensorflow`, `transformers`
507
+ - Data visualization: `matplotlib`, `seaborn`, `plotly`
508
+ - And many more!
509
+
510
+ See `examples/demo_with_pip_packages.py` for comprehensive examples.
511
+
512
+ ## Installation
513
+
514
+ ```bash
515
+ # Development installation
516
+ pip install -e .
517
+
518
+ # Or install from PyPI (when available)
519
+ pip install remotemedia
520
+
521
+ # Install with OmniASR support (multilingual transcription)
522
+ pip install -e ".[omniasr]"
523
+ ```
524
+
525
+ ## Environment Variables
526
+
527
+ ### OmniASR Transcription
528
+
529
+ When using the OmniASR node for multilingual speech transcription:
530
+
531
+ - **`FAIRSEQ2_CACHE_DIR`** (optional): Directory for caching downloaded OmniASR models
532
+ - Default: `~/.cache/fairseq2/`
533
+ - Example: `export FAIRSEQ2_CACHE_DIR=/data/models/fairseq2`
534
+ - Models are 1-6 GB depending on variant (omniASR_LLM_1B vs omniASR_LLM_300M)
535
+
536
+ - **`HF_TOKEN`** (optional): HuggingFace authentication token
537
+ - Required only if accessing gated/private models
538
+ - Example: `export HF_TOKEN=hf_...`
539
+ - Get token from: https://huggingface.co/settings/tokens
540
+
541
+ ### General Configuration
542
+
543
+ - **`REMOTEMEDIA_LOG_LEVEL`** (optional): Logging verbosity
544
+ - Values: `DEBUG`, `INFO`, `WARNING`, `ERROR`
545
+ - Default: `INFO`
546
+
547
+ ## Project Structure
548
+
549
+ ```
550
+ remotemedia/ # Core SDK package
551
+ ├── core/ # Core pipeline and node classes
552
+ │ ├── pipeline.py # Pipeline management with export/import
553
+ │ ├── pipeline_registry.py # Global pipeline registry for discovery
554
+ │ ├── node.py # Base Node and RemoteExecutorConfig
555
+ │ └── exceptions.py # Custom exceptions
556
+ ├── nodes/ # Built-in processing nodes
557
+ │ ├── base.py # Basic utility nodes (PassThrough, Buffer)
558
+ │ ├── audio.py # Audio processing nodes
559
+ │ ├── video.py # Video processing nodes
560
+ │ ├── transform.py # Data transformation nodes
561
+ │ ├── calculator.py # Calculator node for testing
562
+ │ ├── text_processor.py # Text processing node
563
+ │ ├── code_executor.py # Remote Python code execution
564
+ │ ├── serialized_class_executor.py # CloudPickle class execution
565
+ │ └── io_nodes.py # DataSource/Sink nodes for JavaScript I/O
566
+ ├── packaging/ # Code & dependency packaging (Phase 3)
567
+ │ ├── dependency_analyzer.py # AST-based import analysis
568
+ │ └── code_packager.py # Archive creation with dependencies
569
+ ├── webrtc/ # WebRTC communication
570
+ │ └── manager.py # WebRTC connection manager
571
+ ├── remote/ # Remote execution client
572
+ │ ├── client.py # gRPC remote execution client
573
+ │ └── proxy_client.py # Transparent proxy for ANY Python object
574
+ ├── serialization/ # Data serialization utilities
575
+ │ └── base.py # JSON and Pickle serializers
576
+ ├── utils/ # Common utilities
577
+ │ └── logging.py # Logging configuration
578
+ └── cli.py # Command-line interface
579
+
580
+ examples/ # Example applications
581
+ ├── basic_pipeline.py # Basic local pipeline usage
582
+ ├── simple_remote_test.py # Remote execution examples
583
+ └── README.md # Examples documentation
584
+
585
+ tests/ # Comprehensive test suite
586
+ ├── test_pipeline.py # Pipeline class tests
587
+ ├── test_connection.py # Basic connection tests
588
+ ├── test_working_system.py # System integration tests
589
+ ├── test_remote_code_execution.py # Remote Python execution
590
+ ├── test_cloudpickle_execution.py # CloudPickle class execution
591
+ ├── test_dependency_packaging.py # AST analysis & packaging
592
+ ├── test_custom_node_remote_execution.py # Custom node execution
593
+ ├── test_custom_library_packaging.py # Custom library tests
594
+ ├── test_existing_custom_library.py # Real file dependency tests
595
+ ├── import_detection_tests/ # Test files for dependency analysis
596
+ └── run_remote_test.py # Test runner utilities
597
+
598
+ remote_service/ # Remote execution service (Docker)
599
+ ├── src/ # gRPC server implementation
600
+ ├── Dockerfile # Container configuration
601
+ ├── requirements.txt # Service dependencies
602
+ └── README.md # Service documentation
603
+
604
+ docs/ # Documentation
605
+ scripts/ # Development scripts
606
+ ```
607
+
608
+ ## Documentation
609
+
610
+ - [**Developer Guide**](DEVELOPER_GUIDE.md) - **Start here!** Essential guide for building with the SDK.
611
+ - [**Pipeline Developer Guide**](PIPELINE_DEVELOPER_GUIDE.md) - Complete guide to pipeline export and JavaScript integration
612
+ - [**Pipeline Registry Integration**](PIPELINE_REGISTRY_INTEGRATION.md) - WebRTC server integration with pipeline registry
613
+ - [**TypeScript/Node.js Usage**](docs/TYPESCRIPT_USAGE.md) - Guide for using the SDK from Node.js applications
614
+ - [Development Strategy](DevelopmentStrategyDocument.md)
615
+ - [Project Tracking](PROJECT_TRACKING.md)
616
+ - [API Documentation](docs/) (Coming soon)
617
+
618
+ ## Contributing
619
+
620
+ This project is in early development. Please see `PROJECT_TRACKING.md` for current development status and priorities.
621
+
622
+ ## License
623
+
624
+ [License to be determined]
625
+
626
+ ## Requirements
627
+
628
+ - Python 3.9+
629
+ - See `requirements.txt` for dependencies