blanchon commited on
Commit
87e57a0
·
1 Parent(s): 1d17b32
.dockerignore CHANGED
@@ -36,6 +36,7 @@ venv.bak/
36
  *.swp
37
  *.swo
38
  *~
 
39
 
40
  # OS generated files
41
  .DS_Store
@@ -46,15 +47,21 @@ venv.bak/
46
  ehthumbs.db
47
  Thumbs.db
48
 
49
- # Git
50
  .git/
51
  .gitignore
52
  .gitattributes
 
 
 
 
 
53
 
54
  # Documentation
55
  README.md
56
- *.md
57
  docs/
 
 
58
 
59
  # Test files
60
  tests/
@@ -64,6 +71,10 @@ test_*
64
  .coverage
65
  htmlcov/
66
  .tox/
 
 
 
 
67
 
68
  # Logs
69
  *.log
@@ -96,6 +107,10 @@ docker-compose*.yml
96
  .gitlab-ci.yml
97
  .travis.yml
98
  .circleci/
 
 
 
 
99
 
100
  # Large files that shouldn't be in container
101
  *.mp4
@@ -104,4 +119,20 @@ docker-compose*.yml
104
  *.mkv
105
  *.h264
106
  *.h265
107
- recordings/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  *.swp
37
  *.swo
38
  *~
39
+ .cursor/
40
 
41
  # OS generated files
42
  .DS_Store
 
47
  ehthumbs.db
48
  Thumbs.db
49
 
50
+ # Git (including submodule git directories)
51
  .git/
52
  .gitignore
53
  .gitattributes
54
+ .gitmodules
55
+ external/*/.git/
56
+ external/*/.github/
57
+ external/*/.gitignore
58
+ external/*/.gitattributes
59
 
60
  # Documentation
61
  README.md
 
62
  docs/
63
+ # Note: Keep README.md for submodules as they may be needed by build systems
64
+ external/*/docs/
65
 
66
  # Test files
67
  tests/
 
71
  .coverage
72
  htmlcov/
73
  .tox/
74
+ external/*/tests/
75
+ external/*/test_*
76
+ external/*/*_test.py
77
+ external/*/.pytest_cache/
78
 
79
  # Logs
80
  *.log
 
107
  .gitlab-ci.yml
108
  .travis.yml
109
  .circleci/
110
+ external/*/.github/
111
+ external/*/.gitlab-ci.yml
112
+ external/*/.travis.yml
113
+ external/*/.circleci/
114
 
115
  # Large files that shouldn't be in container
116
  *.mp4
 
119
  *.mkv
120
  *.h264
121
  *.h265
122
+ recordings/
123
+
124
+ # Submodule specific exclusions
125
+ external/*/media/
126
+ external/*/benchmarks/
127
+ external/*/examples/
128
+ external/*/demo/
129
+ external/*/client/examples/
130
+ external/lerobot/docker/
131
+ external/*/Makefile
132
+ external/*/.pre-commit-config.yaml
133
+ external/*/.dockerignore
134
+ external/*/Dockerfile*
135
+ external/*/test-docker.sh
136
+
137
+ # Development packages directory
138
+ packages/
.gitignore CHANGED
@@ -1,2 +1,87 @@
1
- ./packages
2
- ./checkpoints
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python cache and build artifacts
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ MANIFEST
23
+
24
+ # Virtual environments
25
+ .env
26
+ .venv
27
+ env/
28
+ venv/
29
+ ENV/
30
+ env.bak/
31
+ venv.bak/
32
+
33
+ # UV cache and lock files (keep uv.lock in git)
34
+ .uv/
35
+
36
+ # IDE and editor files
37
+ .vscode/
38
+ .idea/
39
+ *.swp
40
+ *.swo
41
+ *~
42
+ .cursor/
43
+
44
+ # OS generated files
45
+ .DS_Store
46
+ .DS_Store?
47
+ ._*
48
+ .Spotlight-V100
49
+ .Trashes
50
+ ehthumbs.db
51
+ Thumbs.db
52
+
53
+ # Test files
54
+ .pytest_cache/
55
+ .coverage
56
+ htmlcov/
57
+ .tox/
58
+
59
+ # Model checkpoints (downloaded at runtime)
60
+ checkpoints/
61
+
62
+ # Local packages directory
63
+ packages/
64
+
65
+ # Environment files
66
+ .env.local
67
+ .env.development
68
+ .env.test
69
+
70
+ # Logs
71
+ *.log
72
+ logs/
73
+
74
+ # Temporary files
75
+ *.tmp
76
+ *.temp
77
+ tmp/
78
+ temp/
79
+
80
+ # Large media files
81
+ *.mp4
82
+ *.avi
83
+ *.mov
84
+ *.mkv
85
+ *.h264
86
+ *.h265
87
+ recordings/
Dockerfile CHANGED
@@ -1,10 +1,11 @@
1
  # Use official UV base image with Python 3.12
2
  FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
3
 
4
- # Set environment variables for Python
5
  ENV PYTHONUNBUFFERED=1 \
6
  PYTHONDONTWRITEBYTECODE=1 \
7
  UV_SYSTEM_PYTHON=1 \
 
8
  UV_CACHE_DIR=/tmp/uv-cache
9
 
10
  # Install system dependencies
@@ -34,19 +35,23 @@ RUN groupadd -r appuser && useradd -r -g appuser -m -s /bin/bash appuser
34
  # Set working directory
35
  WORKDIR /app
36
 
37
- # Copy dependency files
38
- COPY --chown=appuser:appuser pyproject.toml ./
39
 
40
- # Copy the external python client dependency
41
  COPY --chown=appuser:appuser external/ ./external/
42
 
43
- # Install Python dependencies (without --frozen to regenerate lock)
44
  RUN --mount=type=cache,target=/tmp/uv-cache \
45
- uv sync --no-dev
46
 
47
- # Copy the entire project
48
  COPY --chown=appuser:appuser . .
49
 
 
 
 
 
50
  # Switch to non-root user
51
  USER appuser
52
 
@@ -56,9 +61,9 @@ ENV PATH="/app/.venv/bin:$PATH"
56
  # Expose port 7860 (HuggingFace Spaces default)
57
  EXPOSE 7860
58
 
59
- # Health check using activated virtual environment (FastAPI health endpoint)
60
  HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
61
  CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/api/health')" || exit 1
62
 
63
- # Run the application with activated virtual environment
64
  CMD ["python", "launch_simple.py", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Use official UV base image with Python 3.12
2
  FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
3
 
4
+ # Set environment variables for Python and UV
5
  ENV PYTHONUNBUFFERED=1 \
6
  PYTHONDONTWRITEBYTECODE=1 \
7
  UV_SYSTEM_PYTHON=1 \
8
+ UV_COMPILE_BYTECODE=1 \
9
  UV_CACHE_DIR=/tmp/uv-cache
10
 
11
  # Install system dependencies
 
35
  # Set working directory
36
  WORKDIR /app
37
 
38
+ # Copy dependency files for better layer caching
39
+ COPY --chown=appuser:appuser pyproject.toml uv.lock* ./
40
 
41
+ # Copy external dependencies (submodules) needed for dependency resolution
42
  COPY --chown=appuser:appuser external/ ./external/
43
 
44
+ # Install dependencies first (better caching)
45
  RUN --mount=type=cache,target=/tmp/uv-cache \
46
+ uv sync --locked --no-install-project --no-dev
47
 
48
+ # Copy the rest of the application
49
  COPY --chown=appuser:appuser . .
50
 
51
+ # Install the project in non-editable mode for production
52
+ RUN --mount=type=cache,target=/tmp/uv-cache \
53
+ uv sync --locked --no-editable --no-dev
54
+
55
  # Switch to non-root user
56
  USER appuser
57
 
 
61
  # Expose port 7860 (HuggingFace Spaces default)
62
  EXPOSE 7860
63
 
64
+ # Health check
65
  HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
66
  CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/api/health')" || exit 1
67
 
68
+ # Run the application
69
  CMD ["python", "launch_simple.py", "--host", "0.0.0.0", "--port", "7860"]
README_INTEGRATION.md DELETED
@@ -1,138 +0,0 @@
1
- # 🤖 Integrated Inference Server
2
-
3
- This is an integrated ACT Model Inference Server that combines **FastAPI** and **Gradio** on a single port, perfect for deployment and development.
4
-
5
- ## 🚀 Quick Start
6
-
7
- ```bash
8
- # Install dependencies
9
- uv sync
10
-
11
- # Run the integrated server
12
- uv run python launch_simple.py --host 0.0.0.0 --port 7860
13
- ```
14
-
15
- ## 📡 Access Points
16
-
17
- Once running, you can access:
18
-
19
- - **🎨 Gradio UI**: http://localhost:7860/
20
- - **📖 API Documentation**: http://localhost:7860/api/docs
21
- - **🔄 Health Check**: http://localhost:7860/api/health
22
- - **📋 OpenAPI Schema**: http://localhost:7860/api/openapi.json
23
-
24
- ## 🏗️ Architecture
25
-
26
- ### Integration Approach
27
- - **Single Process**: Everything runs in one Python process
28
- - **Single Port**: Both API and UI on the same port (7860)
29
- - **FastAPI at `/api`**: Full REST API with automatic documentation
30
- - **Gradio at `/`**: User-friendly web interface
31
- - **Direct Session Management**: UI communicates directly with session manager (no HTTP overhead)
32
-
33
- ### Key Components
34
-
35
- 1. **`simple_integrated.py`**: Main integration logic
36
- - Creates FastAPI app and mounts it at `/api`
37
- - Creates Gradio interface and mounts it at `/`
38
- - Provides `SimpleServerManager` for direct session access
39
-
40
- 2. **`launch_simple.py`**: Entry point script
41
- - Handles command-line arguments
42
- - Starts the integrated application
43
-
44
- 3. **`main.py`**: Core FastAPI application
45
- - Session management endpoints
46
- - Policy loading and inference
47
- - OpenAPI documentation
48
-
49
- ## 🔧 Features
50
-
51
- ### For UI Users
52
- - ✅ **Simple Interface**: Create and manage AI sessions through web UI
53
- - ✅ **Real-time Status**: Live session monitoring and control
54
- - ✅ **Direct Performance**: No HTTP overhead for UI operations
55
-
56
- ### For API Users
57
- - ✅ **Full REST API**: Complete programmatic access
58
- - ✅ **Interactive Docs**: Automatic Swagger/OpenAPI documentation
59
- - ✅ **Standard Endpoints**: `/sessions`, `/health`, etc.
60
- - ✅ **CORS Enabled**: Ready for frontend integration
61
-
62
- ### For Deployment
63
- - ✅ **Single Port**: Easy to deploy behind reverse proxy
64
- - ✅ **Docker Ready**: Dockerfile included
65
- - ✅ **Health Checks**: Built-in monitoring endpoints
66
- - ✅ **HuggingFace Spaces**: Perfect for cloud deployment
67
-
68
- ## 📋 API Usage Examples
69
-
70
- ### Health Check
71
- ```bash
72
- curl http://localhost:7860/api/health
73
- ```
74
-
75
- ### Create Session
76
- ```bash
77
- curl -X POST http://localhost:7860/api/sessions \
78
- -H "Content-Type: application/json" \
79
- -d '{
80
- "session_id": "my-robot",
81
- "policy_path": "./checkpoints/act_so101_beyond",
82
- "camera_names": ["front"],
83
- "arena_server_url": "http://localhost:8000"
84
- }'
85
- ```
86
-
87
- ### Start Inference
88
- ```bash
89
- curl -X POST http://localhost:7860/api/sessions/my-robot/start
90
- ```
91
-
92
- ### Get Session Status
93
- ```bash
94
- curl http://localhost:7860/api/sessions/my-robot
95
- ```
96
-
97
- ## 🐳 Docker Usage
98
-
99
- ```bash
100
- # Build
101
- docker build -t inference-server .
102
-
103
- # Run
104
- docker run -p 7860:7860 inference-server
105
- ```
106
-
107
- ## 🔍 Testing
108
-
109
- Run the integration test to verify everything works:
110
-
111
- ```bash
112
- uv run python test_integration.py
113
- ```
114
-
115
- ## 💡 Development Tips
116
-
117
- ### Use Both Interfaces
118
- - **Development**: Use Gradio UI for quick testing and setup
119
- - **Production**: Use REST API for automated systems
120
- - **Integration**: Both can run simultaneously
121
-
122
- ### Session Management
123
- - UI uses direct session manager access (faster)
124
- - API uses HTTP endpoints (standard REST)
125
- - Both share the same underlying session data
126
-
127
- ### Debugging
128
- - Check logs for startup issues
129
- - Use `/api/health` to verify API is working
130
- - Visit `/api/docs` for interactive API testing
131
-
132
- ## 🚀 Benefits of This Approach
133
-
134
- 1. **Flexibility**: Use UI or API as needed
135
- 2. **Performance**: Direct access for UI, standard REST for API
136
- 3. **Deployment**: Single port, single process
137
- 4. **Documentation**: Auto-generated API docs
138
- 5. **Development**: Fast iteration with integrated setup
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
client/package.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "name": "@robohub/inference-server-client",
3
  "version": "1.0.0",
4
  "description": "TypeScript client for LeRobot Arena Inference Server - ACT model inference and session management",
5
  "module": "dist/index.js",
@@ -24,7 +24,7 @@
24
  "test": "bun test",
25
  "typecheck": "bunx tsc --noEmit",
26
  "clean": "rm -rf dist src/generated",
27
- "export-openapi": "cd .. && uv run python -m inference_server.export_openapi --output client/openapi.json",
28
  "generate-client": "bunx @hey-api/openapi-ts -i openapi.json -o src/generated -c @hey-api/client-fetch",
29
  "generate": "bun run export-openapi && bun run generate-client",
30
  "prebuild": "bun run clean && bun run generate"
@@ -54,7 +54,7 @@
54
  },
55
  "repository": {
56
  "type": "git",
57
- "url": "git+https://github.com/julien-blanchon/RoboHub.git#main:services/inference-server/client",
58
  "directory": "services/inference-server/client"
59
  },
60
  "engines": {
 
1
  {
2
+ "name": "@robothub/inference-server-client",
3
  "version": "1.0.0",
4
  "description": "TypeScript client for LeRobot Arena Inference Server - ACT model inference and session management",
5
  "module": "dist/index.js",
 
24
  "test": "bun test",
25
  "typecheck": "bunx tsc --noEmit",
26
  "clean": "rm -rf dist src/generated",
27
+ "export-openapi": "cd .. && uv run --active python -m inference_server.export_openapi --output client/openapi.json",
28
  "generate-client": "bunx @hey-api/openapi-ts -i openapi.json -o src/generated -c @hey-api/client-fetch",
29
  "generate": "bun run export-openapi && bun run generate-client",
30
  "prebuild": "bun run clean && bun run generate"
 
54
  },
55
  "repository": {
56
  "type": "git",
57
+ "url": "git+https://github.com/julien-blanchon/robothub.git#main:services/inference-server/client",
58
  "directory": "services/inference-server/client"
59
  },
60
  "engines": {
client/src/generated/index.ts DELETED
@@ -1,4 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export * from './schemas.gen';
3
- export * from './services.gen';
4
- export * from './types.gen';
 
 
 
 
 
client/src/generated/schemas.gen.ts DELETED
@@ -1,196 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- export const CreateSessionRequestSchema = {
4
- properties: {
5
- session_id: {
6
- type: 'string',
7
- title: 'Session Id'
8
- },
9
- policy_path: {
10
- type: 'string',
11
- title: 'Policy Path'
12
- },
13
- camera_names: {
14
- items: {
15
- type: 'string'
16
- },
17
- type: 'array',
18
- title: 'Camera Names',
19
- default: ['front']
20
- },
21
- arena_server_url: {
22
- type: 'string',
23
- title: 'Arena Server Url',
24
- default: 'http://localhost:8000'
25
- },
26
- workspace_id: {
27
- anyOf: [
28
- {
29
- type: 'string'
30
- },
31
- {
32
- type: 'null'
33
- }
34
- ],
35
- title: 'Workspace Id'
36
- },
37
- policy_type: {
38
- type: 'string',
39
- title: 'Policy Type',
40
- default: 'act'
41
- },
42
- language_instruction: {
43
- anyOf: [
44
- {
45
- type: 'string'
46
- },
47
- {
48
- type: 'null'
49
- }
50
- ],
51
- title: 'Language Instruction'
52
- }
53
- },
54
- type: 'object',
55
- required: ['session_id', 'policy_path'],
56
- title: 'CreateSessionRequest'
57
- } as const;
58
-
59
- export const CreateSessionResponseSchema = {
60
- properties: {
61
- workspace_id: {
62
- type: 'string',
63
- title: 'Workspace Id'
64
- },
65
- camera_room_ids: {
66
- additionalProperties: {
67
- type: 'string'
68
- },
69
- type: 'object',
70
- title: 'Camera Room Ids'
71
- },
72
- joint_input_room_id: {
73
- type: 'string',
74
- title: 'Joint Input Room Id'
75
- },
76
- joint_output_room_id: {
77
- type: 'string',
78
- title: 'Joint Output Room Id'
79
- }
80
- },
81
- type: 'object',
82
- required: ['workspace_id', 'camera_room_ids', 'joint_input_room_id', 'joint_output_room_id'],
83
- title: 'CreateSessionResponse'
84
- } as const;
85
-
86
- export const HTTPValidationErrorSchema = {
87
- properties: {
88
- detail: {
89
- items: {
90
- '$ref': '#/components/schemas/ValidationError'
91
- },
92
- type: 'array',
93
- title: 'Detail'
94
- }
95
- },
96
- type: 'object',
97
- title: 'HTTPValidationError'
98
- } as const;
99
-
100
- export const SessionStatusResponseSchema = {
101
- properties: {
102
- session_id: {
103
- type: 'string',
104
- title: 'Session Id'
105
- },
106
- status: {
107
- type: 'string',
108
- title: 'Status'
109
- },
110
- policy_path: {
111
- type: 'string',
112
- title: 'Policy Path'
113
- },
114
- policy_type: {
115
- type: 'string',
116
- title: 'Policy Type'
117
- },
118
- camera_names: {
119
- items: {
120
- type: 'string'
121
- },
122
- type: 'array',
123
- title: 'Camera Names'
124
- },
125
- workspace_id: {
126
- type: 'string',
127
- title: 'Workspace Id'
128
- },
129
- rooms: {
130
- additionalProperties: true,
131
- type: 'object',
132
- title: 'Rooms'
133
- },
134
- stats: {
135
- additionalProperties: true,
136
- type: 'object',
137
- title: 'Stats'
138
- },
139
- inference_stats: {
140
- anyOf: [
141
- {
142
- additionalProperties: true,
143
- type: 'object'
144
- },
145
- {
146
- type: 'null'
147
- }
148
- ],
149
- title: 'Inference Stats'
150
- },
151
- error_message: {
152
- anyOf: [
153
- {
154
- type: 'string'
155
- },
156
- {
157
- type: 'null'
158
- }
159
- ],
160
- title: 'Error Message'
161
- }
162
- },
163
- type: 'object',
164
- required: ['session_id', 'status', 'policy_path', 'policy_type', 'camera_names', 'workspace_id', 'rooms', 'stats'],
165
- title: 'SessionStatusResponse'
166
- } as const;
167
-
168
- export const ValidationErrorSchema = {
169
- properties: {
170
- loc: {
171
- items: {
172
- anyOf: [
173
- {
174
- type: 'string'
175
- },
176
- {
177
- type: 'integer'
178
- }
179
- ]
180
- },
181
- type: 'array',
182
- title: 'Location'
183
- },
184
- msg: {
185
- type: 'string',
186
- title: 'Message'
187
- },
188
- type: {
189
- type: 'string',
190
- title: 'Error Type'
191
- }
192
- },
193
- type: 'object',
194
- required: ['loc', 'msg', 'type'],
195
- title: 'ValidationError'
196
- } as const;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
client/src/generated/services.gen.ts DELETED
@@ -1,164 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- import { createClient, createConfig, type Options } from '@hey-api/client-fetch';
4
- import type { RootGetError, RootGetResponse, HealthCheckHealthGetError, HealthCheckHealthGetResponse, ListPoliciesPoliciesGetError, ListPoliciesPoliciesGetResponse, ListSessionsSessionsGetError, ListSessionsSessionsGetResponse, CreateSessionSessionsPostData, CreateSessionSessionsPostError, CreateSessionSessionsPostResponse, GetSessionStatusSessionsSessionIdGetData, GetSessionStatusSessionsSessionIdGetError, GetSessionStatusSessionsSessionIdGetResponse, DeleteSessionSessionsSessionIdDeleteData, DeleteSessionSessionsSessionIdDeleteError, DeleteSessionSessionsSessionIdDeleteResponse, StartInferenceSessionsSessionIdStartPostData, StartInferenceSessionsSessionIdStartPostError, StartInferenceSessionsSessionIdStartPostResponse, StopInferenceSessionsSessionIdStopPostData, StopInferenceSessionsSessionIdStopPostError, StopInferenceSessionsSessionIdStopPostResponse, RestartInferenceSessionsSessionIdRestartPostData, RestartInferenceSessionsSessionIdRestartPostError, RestartInferenceSessionsSessionIdRestartPostResponse, GetSystemInfoDebugSystemGetError, GetSystemInfoDebugSystemGetResponse, GetRecentLogsDebugLogsGetError, GetRecentLogsDebugLogsGetResponse, DebugResetSessionDebugSessionsSessionIdResetPostData, DebugResetSessionDebugSessionsSessionIdResetPostError, DebugResetSessionDebugSessionsSessionIdResetPostResponse, GetSessionQueueInfoDebugSessionsSessionIdQueueGetData, GetSessionQueueInfoDebugSessionsSessionIdQueueGetError, GetSessionQueueInfoDebugSessionsSessionIdQueueGetResponse } from './types.gen';
5
-
6
- export const client = createClient(createConfig());
7
-
8
- /**
9
- * Root
10
- * Health check endpoint.
11
- */
12
- export const rootGet = <ThrowOnError extends boolean = false>(options?: Options<unknown, ThrowOnError>) => {
13
- return (options?.client ?? client).get<RootGetResponse, RootGetError, ThrowOnError>({
14
- ...options,
15
- url: '/'
16
- });
17
- };
18
-
19
- /**
20
- * Health Check
21
- * Detailed health check.
22
- */
23
- export const healthCheckHealthGet = <ThrowOnError extends boolean = false>(options?: Options<unknown, ThrowOnError>) => {
24
- return (options?.client ?? client).get<HealthCheckHealthGetResponse, HealthCheckHealthGetError, ThrowOnError>({
25
- ...options,
26
- url: '/health'
27
- });
28
- };
29
-
30
- /**
31
- * List Policies
32
- * List supported policy types.
33
- */
34
- export const listPoliciesPoliciesGet = <ThrowOnError extends boolean = false>(options?: Options<unknown, ThrowOnError>) => {
35
- return (options?.client ?? client).get<ListPoliciesPoliciesGetResponse, ListPoliciesPoliciesGetError, ThrowOnError>({
36
- ...options,
37
- url: '/policies'
38
- });
39
- };
40
-
41
- /**
42
- * List Sessions
43
- * List all sessions.
44
- */
45
- export const listSessionsSessionsGet = <ThrowOnError extends boolean = false>(options?: Options<unknown, ThrowOnError>) => {
46
- return (options?.client ?? client).get<ListSessionsSessionsGetResponse, ListSessionsSessionsGetError, ThrowOnError>({
47
- ...options,
48
- url: '/sessions'
49
- });
50
- };
51
-
52
- /**
53
- * Create Session
54
- * Create a new inference session.
55
- *
56
- * If workspace_id is provided, all rooms will be created in that workspace.
57
- * If workspace_id is not provided, a new workspace will be generated automatically.
58
- * All rooms for a session (cameras + joints) are always created in the same workspace.
59
- */
60
- export const createSessionSessionsPost = <ThrowOnError extends boolean = false>(options: Options<CreateSessionSessionsPostData, ThrowOnError>) => {
61
- return (options?.client ?? client).post<CreateSessionSessionsPostResponse, CreateSessionSessionsPostError, ThrowOnError>({
62
- ...options,
63
- url: '/sessions'
64
- });
65
- };
66
-
67
- /**
68
- * Get Session Status
69
- * Get status of a specific session.
70
- */
71
- export const getSessionStatusSessionsSessionIdGet = <ThrowOnError extends boolean = false>(options: Options<GetSessionStatusSessionsSessionIdGetData, ThrowOnError>) => {
72
- return (options?.client ?? client).get<GetSessionStatusSessionsSessionIdGetResponse, GetSessionStatusSessionsSessionIdGetError, ThrowOnError>({
73
- ...options,
74
- url: '/sessions/{session_id}'
75
- });
76
- };
77
-
78
- /**
79
- * Delete Session
80
- * Delete a session.
81
- */
82
- export const deleteSessionSessionsSessionIdDelete = <ThrowOnError extends boolean = false>(options: Options<DeleteSessionSessionsSessionIdDeleteData, ThrowOnError>) => {
83
- return (options?.client ?? client).delete<DeleteSessionSessionsSessionIdDeleteResponse, DeleteSessionSessionsSessionIdDeleteError, ThrowOnError>({
84
- ...options,
85
- url: '/sessions/{session_id}'
86
- });
87
- };
88
-
89
- /**
90
- * Start Inference
91
- * Start inference for a session.
92
- */
93
- export const startInferenceSessionsSessionIdStartPost = <ThrowOnError extends boolean = false>(options: Options<StartInferenceSessionsSessionIdStartPostData, ThrowOnError>) => {
94
- return (options?.client ?? client).post<StartInferenceSessionsSessionIdStartPostResponse, StartInferenceSessionsSessionIdStartPostError, ThrowOnError>({
95
- ...options,
96
- url: '/sessions/{session_id}/start'
97
- });
98
- };
99
-
100
- /**
101
- * Stop Inference
102
- * Stop inference for a session.
103
- */
104
- export const stopInferenceSessionsSessionIdStopPost = <ThrowOnError extends boolean = false>(options: Options<StopInferenceSessionsSessionIdStopPostData, ThrowOnError>) => {
105
- return (options?.client ?? client).post<StopInferenceSessionsSessionIdStopPostResponse, StopInferenceSessionsSessionIdStopPostError, ThrowOnError>({
106
- ...options,
107
- url: '/sessions/{session_id}/stop'
108
- });
109
- };
110
-
111
- /**
112
- * Restart Inference
113
- * Restart inference for a session.
114
- */
115
- export const restartInferenceSessionsSessionIdRestartPost = <ThrowOnError extends boolean = false>(options: Options<RestartInferenceSessionsSessionIdRestartPostData, ThrowOnError>) => {
116
- return (options?.client ?? client).post<RestartInferenceSessionsSessionIdRestartPostResponse, RestartInferenceSessionsSessionIdRestartPostError, ThrowOnError>({
117
- ...options,
118
- url: '/sessions/{session_id}/restart'
119
- });
120
- };
121
-
122
- /**
123
- * Get System Info
124
- * Get system information for debugging.
125
- */
126
- export const getSystemInfoDebugSystemGet = <ThrowOnError extends boolean = false>(options?: Options<unknown, ThrowOnError>) => {
127
- return (options?.client ?? client).get<GetSystemInfoDebugSystemGetResponse, GetSystemInfoDebugSystemGetError, ThrowOnError>({
128
- ...options,
129
- url: '/debug/system'
130
- });
131
- };
132
-
133
- /**
134
- * Get Recent Logs
135
- * Get recent log entries for debugging.
136
- */
137
- export const getRecentLogsDebugLogsGet = <ThrowOnError extends boolean = false>(options?: Options<unknown, ThrowOnError>) => {
138
- return (options?.client ?? client).get<GetRecentLogsDebugLogsGetResponse, GetRecentLogsDebugLogsGetError, ThrowOnError>({
139
- ...options,
140
- url: '/debug/logs'
141
- });
142
- };
143
-
144
- /**
145
- * Debug Reset Session
146
- * Reset a session's internal state for debugging.
147
- */
148
- export const debugResetSessionDebugSessionsSessionIdResetPost = <ThrowOnError extends boolean = false>(options: Options<DebugResetSessionDebugSessionsSessionIdResetPostData, ThrowOnError>) => {
149
- return (options?.client ?? client).post<DebugResetSessionDebugSessionsSessionIdResetPostResponse, DebugResetSessionDebugSessionsSessionIdResetPostError, ThrowOnError>({
150
- ...options,
151
- url: '/debug/sessions/{session_id}/reset'
152
- });
153
- };
154
-
155
- /**
156
- * Get Session Queue Info
157
- * Get detailed information about a session's action queue.
158
- */
159
- export const getSessionQueueInfoDebugSessionsSessionIdQueueGet = <ThrowOnError extends boolean = false>(options: Options<GetSessionQueueInfoDebugSessionsSessionIdQueueGetData, ThrowOnError>) => {
160
- return (options?.client ?? client).get<GetSessionQueueInfoDebugSessionsSessionIdQueueGetResponse, GetSessionQueueInfoDebugSessionsSessionIdQueueGetError, ThrowOnError>({
161
- ...options,
162
- url: '/debug/sessions/{session_id}/queue'
163
- });
164
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
client/src/generated/types.gen.ts DELETED
@@ -1,151 +0,0 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
-
3
- export type CreateSessionRequest = {
4
- session_id: string;
5
- policy_path: string;
6
- camera_names?: Array<(string)>;
7
- arena_server_url?: string;
8
- workspace_id?: (string | null);
9
- policy_type?: string;
10
- language_instruction?: (string | null);
11
- };
12
-
13
- export type CreateSessionResponse = {
14
- workspace_id: string;
15
- camera_room_ids: {
16
- [key: string]: (string);
17
- };
18
- joint_input_room_id: string;
19
- joint_output_room_id: string;
20
- };
21
-
22
- export type HTTPValidationError = {
23
- detail?: Array<ValidationError>;
24
- };
25
-
26
- export type SessionStatusResponse = {
27
- session_id: string;
28
- status: string;
29
- policy_path: string;
30
- policy_type: string;
31
- camera_names: Array<(string)>;
32
- workspace_id: string;
33
- rooms: {
34
- [key: string]: unknown;
35
- };
36
- stats: {
37
- [key: string]: unknown;
38
- };
39
- inference_stats?: ({
40
- [key: string]: unknown;
41
- } | null);
42
- error_message?: (string | null);
43
- };
44
-
45
- export type ValidationError = {
46
- loc: Array<(string | number)>;
47
- msg: string;
48
- type: string;
49
- };
50
-
51
- export type RootGetResponse = (unknown);
52
-
53
- export type RootGetError = unknown;
54
-
55
- export type HealthCheckHealthGetResponse = (unknown);
56
-
57
- export type HealthCheckHealthGetError = unknown;
58
-
59
- export type ListPoliciesPoliciesGetResponse = (unknown);
60
-
61
- export type ListPoliciesPoliciesGetError = unknown;
62
-
63
- export type ListSessionsSessionsGetResponse = (Array<SessionStatusResponse>);
64
-
65
- export type ListSessionsSessionsGetError = unknown;
66
-
67
- export type CreateSessionSessionsPostData = {
68
- body: CreateSessionRequest;
69
- };
70
-
71
- export type CreateSessionSessionsPostResponse = (CreateSessionResponse);
72
-
73
- export type CreateSessionSessionsPostError = (HTTPValidationError);
74
-
75
- export type GetSessionStatusSessionsSessionIdGetData = {
76
- path: {
77
- session_id: string;
78
- };
79
- };
80
-
81
- export type GetSessionStatusSessionsSessionIdGetResponse = (SessionStatusResponse);
82
-
83
- export type GetSessionStatusSessionsSessionIdGetError = (HTTPValidationError);
84
-
85
- export type DeleteSessionSessionsSessionIdDeleteData = {
86
- path: {
87
- session_id: string;
88
- };
89
- };
90
-
91
- export type DeleteSessionSessionsSessionIdDeleteResponse = (unknown);
92
-
93
- export type DeleteSessionSessionsSessionIdDeleteError = (HTTPValidationError);
94
-
95
- export type StartInferenceSessionsSessionIdStartPostData = {
96
- path: {
97
- session_id: string;
98
- };
99
- };
100
-
101
- export type StartInferenceSessionsSessionIdStartPostResponse = (unknown);
102
-
103
- export type StartInferenceSessionsSessionIdStartPostError = (HTTPValidationError);
104
-
105
- export type StopInferenceSessionsSessionIdStopPostData = {
106
- path: {
107
- session_id: string;
108
- };
109
- };
110
-
111
- export type StopInferenceSessionsSessionIdStopPostResponse = (unknown);
112
-
113
- export type StopInferenceSessionsSessionIdStopPostError = (HTTPValidationError);
114
-
115
- export type RestartInferenceSessionsSessionIdRestartPostData = {
116
- path: {
117
- session_id: string;
118
- };
119
- };
120
-
121
- export type RestartInferenceSessionsSessionIdRestartPostResponse = (unknown);
122
-
123
- export type RestartInferenceSessionsSessionIdRestartPostError = (HTTPValidationError);
124
-
125
- export type GetSystemInfoDebugSystemGetResponse = (unknown);
126
-
127
- export type GetSystemInfoDebugSystemGetError = unknown;
128
-
129
- export type GetRecentLogsDebugLogsGetResponse = (unknown);
130
-
131
- export type GetRecentLogsDebugLogsGetError = unknown;
132
-
133
- export type DebugResetSessionDebugSessionsSessionIdResetPostData = {
134
- path: {
135
- session_id: string;
136
- };
137
- };
138
-
139
- export type DebugResetSessionDebugSessionsSessionIdResetPostResponse = (unknown);
140
-
141
- export type DebugResetSessionDebugSessionsSessionIdResetPostError = (HTTPValidationError);
142
-
143
- export type GetSessionQueueInfoDebugSessionsSessionIdQueueGetData = {
144
- path: {
145
- session_id: string;
146
- };
147
- };
148
-
149
- export type GetSessionQueueInfoDebugSessionsSessionIdQueueGetResponse = (unknown);
150
-
151
- export type GetSessionQueueInfoDebugSessionsSessionIdQueueGetError = (HTTPValidationError);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
openapi.json DELETED
@@ -1,692 +0,0 @@
1
- {
2
- "openapi": "3.1.0",
3
- "info": {
4
- "title": "LeRobot Arena AI Server",
5
- "summary": "ACT Model Inference Server for Real-time Robot Control",
6
- "description": "\n ## LeRobot Arena AI Server\n\n This server provides **ACT (Action Chunking Transformer)** model inference for robotics applications.\n It uses the LeRobot Arena communication system with multiple rooms per session for:\n\n ### Core Features:\n - 🎥 **Multi-camera support**: Arbitrary number of camera streams with unique names\n - 🤖 **Joint control**: Normalized joint value handling (-100 to +100 range)\n - 🔄 **Real-time inference**: Optimized for robotics control loops\n - 📊 **Session management**: Multiple concurrent inference sessions\n - 🛠️ **Debug endpoints**: Comprehensive monitoring and debugging tools\n\n ### Communication Architecture:\n 1. **Camera rooms**: Receives video streams from robot cameras (supports multiple cameras)\n 2. **Joint input room**: Receives current robot joint positions (**NORMALIZED VALUES**)\n 3. **Joint output room**: Sends predicted joint commands (**NORMALIZED VALUES**)\n\n ### Supported Cameras:\n Each camera stream has a unique name (e.g., \"front\", \"wrist\", \"overhead\") \n and all streams are synchronized for inference.\n\n ### Joint Value Convention:\n - All joint inputs/outputs use **NORMALIZED VALUES**\n - Range: -100 to +100 for most joints, 0 to 100 for gripper\n - Matches training data format exactly\n\n ### Getting Started:\n 1. Create a session with your trained ACT model\n 2. Connect your robot to the generated rooms\n 3. Start inference to begin real-time control\n ",
7
- "version": "1.0.0",
8
- "contact": {
9
- "name": "LeRobot Arena Team",
10
- "url": "https://github.com/huggingface/lerobot"
11
- },
12
- "license": {
13
- "name": "Apache 2.0",
14
- "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
15
- },
16
- "x-logo": {
17
- "url": "https://huggingface.co/datasets/huggingface/brand-assets/resolve/main/hf-logo.png",
18
- "altText": "LeRobot Logo"
19
- }
20
- },
21
- "paths": {
22
- "/": {
23
- "get": {
24
- "tags": [
25
- "Health"
26
- ],
27
- "summary": "Root",
28
- "description": "Health check endpoint.",
29
- "operationId": "root__get",
30
- "responses": {
31
- "200": {
32
- "description": "Successful Response",
33
- "content": {
34
- "application/json": {
35
- "schema": {}
36
- }
37
- }
38
- }
39
- }
40
- }
41
- },
42
- "/health": {
43
- "get": {
44
- "tags": [
45
- "Health"
46
- ],
47
- "summary": "Health Check",
48
- "description": "Detailed health check.",
49
- "operationId": "health_check_health_get",
50
- "responses": {
51
- "200": {
52
- "description": "Successful Response",
53
- "content": {
54
- "application/json": {
55
- "schema": {}
56
- }
57
- }
58
- }
59
- }
60
- }
61
- },
62
- "/sessions": {
63
- "get": {
64
- "tags": [
65
- "Sessions"
66
- ],
67
- "summary": "List Sessions",
68
- "description": "List all sessions.",
69
- "operationId": "list_sessions_sessions_get",
70
- "responses": {
71
- "200": {
72
- "description": "Successful Response",
73
- "content": {
74
- "application/json": {
75
- "schema": {
76
- "items": {
77
- "$ref": "#/components/schemas/SessionStatusResponse"
78
- },
79
- "type": "array",
80
- "title": "Response List Sessions Sessions Get"
81
- }
82
- }
83
- }
84
- }
85
- }
86
- },
87
- "post": {
88
- "tags": [
89
- "Sessions"
90
- ],
91
- "summary": "Create Session",
92
- "description": "Create a new inference session.\n\nIf workspace_id is provided, all rooms will be created in that workspace.\nIf workspace_id is not provided, a new workspace will be generated automatically.\nAll rooms for a session (cameras + joints) are always created in the same workspace.",
93
- "operationId": "create_session_sessions_post",
94
- "requestBody": {
95
- "content": {
96
- "application/json": {
97
- "schema": {
98
- "$ref": "#/components/schemas/CreateSessionRequest"
99
- }
100
- }
101
- },
102
- "required": true
103
- },
104
- "responses": {
105
- "200": {
106
- "description": "Successful Response",
107
- "content": {
108
- "application/json": {
109
- "schema": {
110
- "$ref": "#/components/schemas/CreateSessionResponse"
111
- }
112
- }
113
- }
114
- },
115
- "422": {
116
- "description": "Validation Error",
117
- "content": {
118
- "application/json": {
119
- "schema": {
120
- "$ref": "#/components/schemas/HTTPValidationError"
121
- }
122
- }
123
- }
124
- }
125
- }
126
- }
127
- },
128
- "/sessions/{session_id}": {
129
- "get": {
130
- "tags": [
131
- "Sessions"
132
- ],
133
- "summary": "Get Session Status",
134
- "description": "Get status of a specific session.",
135
- "operationId": "get_session_status_sessions__session_id__get",
136
- "parameters": [
137
- {
138
- "name": "session_id",
139
- "in": "path",
140
- "required": true,
141
- "schema": {
142
- "type": "string",
143
- "title": "Session Id"
144
- }
145
- }
146
- ],
147
- "responses": {
148
- "200": {
149
- "description": "Successful Response",
150
- "content": {
151
- "application/json": {
152
- "schema": {
153
- "$ref": "#/components/schemas/SessionStatusResponse"
154
- }
155
- }
156
- }
157
- },
158
- "422": {
159
- "description": "Validation Error",
160
- "content": {
161
- "application/json": {
162
- "schema": {
163
- "$ref": "#/components/schemas/HTTPValidationError"
164
- }
165
- }
166
- }
167
- }
168
- }
169
- },
170
- "delete": {
171
- "tags": [
172
- "Sessions"
173
- ],
174
- "summary": "Delete Session",
175
- "description": "Delete a session.",
176
- "operationId": "delete_session_sessions__session_id__delete",
177
- "parameters": [
178
- {
179
- "name": "session_id",
180
- "in": "path",
181
- "required": true,
182
- "schema": {
183
- "type": "string",
184
- "title": "Session Id"
185
- }
186
- }
187
- ],
188
- "responses": {
189
- "200": {
190
- "description": "Successful Response",
191
- "content": {
192
- "application/json": {
193
- "schema": {}
194
- }
195
- }
196
- },
197
- "422": {
198
- "description": "Validation Error",
199
- "content": {
200
- "application/json": {
201
- "schema": {
202
- "$ref": "#/components/schemas/HTTPValidationError"
203
- }
204
- }
205
- }
206
- }
207
- }
208
- }
209
- },
210
- "/sessions/{session_id}/start": {
211
- "post": {
212
- "tags": [
213
- "Control"
214
- ],
215
- "summary": "Start Inference",
216
- "description": "Start inference for a session.",
217
- "operationId": "start_inference_sessions__session_id__start_post",
218
- "parameters": [
219
- {
220
- "name": "session_id",
221
- "in": "path",
222
- "required": true,
223
- "schema": {
224
- "type": "string",
225
- "title": "Session Id"
226
- }
227
- }
228
- ],
229
- "responses": {
230
- "200": {
231
- "description": "Successful Response",
232
- "content": {
233
- "application/json": {
234
- "schema": {}
235
- }
236
- }
237
- },
238
- "422": {
239
- "description": "Validation Error",
240
- "content": {
241
- "application/json": {
242
- "schema": {
243
- "$ref": "#/components/schemas/HTTPValidationError"
244
- }
245
- }
246
- }
247
- }
248
- }
249
- }
250
- },
251
- "/sessions/{session_id}/stop": {
252
- "post": {
253
- "tags": [
254
- "Control"
255
- ],
256
- "summary": "Stop Inference",
257
- "description": "Stop inference for a session.",
258
- "operationId": "stop_inference_sessions__session_id__stop_post",
259
- "parameters": [
260
- {
261
- "name": "session_id",
262
- "in": "path",
263
- "required": true,
264
- "schema": {
265
- "type": "string",
266
- "title": "Session Id"
267
- }
268
- }
269
- ],
270
- "responses": {
271
- "200": {
272
- "description": "Successful Response",
273
- "content": {
274
- "application/json": {
275
- "schema": {}
276
- }
277
- }
278
- },
279
- "422": {
280
- "description": "Validation Error",
281
- "content": {
282
- "application/json": {
283
- "schema": {
284
- "$ref": "#/components/schemas/HTTPValidationError"
285
- }
286
- }
287
- }
288
- }
289
- }
290
- }
291
- },
292
- "/sessions/{session_id}/restart": {
293
- "post": {
294
- "tags": [
295
- "Control"
296
- ],
297
- "summary": "Restart Inference",
298
- "description": "Restart inference for a session.",
299
- "operationId": "restart_inference_sessions__session_id__restart_post",
300
- "parameters": [
301
- {
302
- "name": "session_id",
303
- "in": "path",
304
- "required": true,
305
- "schema": {
306
- "type": "string",
307
- "title": "Session Id"
308
- }
309
- }
310
- ],
311
- "responses": {
312
- "200": {
313
- "description": "Successful Response",
314
- "content": {
315
- "application/json": {
316
- "schema": {}
317
- }
318
- }
319
- },
320
- "422": {
321
- "description": "Validation Error",
322
- "content": {
323
- "application/json": {
324
- "schema": {
325
- "$ref": "#/components/schemas/HTTPValidationError"
326
- }
327
- }
328
- }
329
- }
330
- }
331
- }
332
- },
333
- "/debug/system": {
334
- "get": {
335
- "tags": [
336
- "Debug"
337
- ],
338
- "summary": "Get System Info",
339
- "description": "Get system information for debugging.",
340
- "operationId": "get_system_info_debug_system_get",
341
- "responses": {
342
- "200": {
343
- "description": "Successful Response",
344
- "content": {
345
- "application/json": {
346
- "schema": {}
347
- }
348
- }
349
- }
350
- }
351
- }
352
- },
353
- "/debug/logs": {
354
- "get": {
355
- "tags": [
356
- "Debug"
357
- ],
358
- "summary": "Get Recent Logs",
359
- "description": "Get recent log entries for debugging.",
360
- "operationId": "get_recent_logs_debug_logs_get",
361
- "responses": {
362
- "200": {
363
- "description": "Successful Response",
364
- "content": {
365
- "application/json": {
366
- "schema": {}
367
- }
368
- }
369
- }
370
- }
371
- }
372
- },
373
- "/debug/sessions/{session_id}/reset": {
374
- "post": {
375
- "tags": [
376
- "Debug"
377
- ],
378
- "summary": "Debug Reset Session",
379
- "description": "Reset a session's internal state for debugging.",
380
- "operationId": "debug_reset_session_debug_sessions__session_id__reset_post",
381
- "parameters": [
382
- {
383
- "name": "session_id",
384
- "in": "path",
385
- "required": true,
386
- "schema": {
387
- "type": "string",
388
- "title": "Session Id"
389
- }
390
- }
391
- ],
392
- "responses": {
393
- "200": {
394
- "description": "Successful Response",
395
- "content": {
396
- "application/json": {
397
- "schema": {}
398
- }
399
- }
400
- },
401
- "422": {
402
- "description": "Validation Error",
403
- "content": {
404
- "application/json": {
405
- "schema": {
406
- "$ref": "#/components/schemas/HTTPValidationError"
407
- }
408
- }
409
- }
410
- }
411
- }
412
- }
413
- },
414
- "/debug/sessions/{session_id}/queue": {
415
- "get": {
416
- "tags": [
417
- "Debug"
418
- ],
419
- "summary": "Get Session Queue Info",
420
- "description": "Get detailed information about a session's action queue.",
421
- "operationId": "get_session_queue_info_debug_sessions__session_id__queue_get",
422
- "parameters": [
423
- {
424
- "name": "session_id",
425
- "in": "path",
426
- "required": true,
427
- "schema": {
428
- "type": "string",
429
- "title": "Session Id"
430
- }
431
- }
432
- ],
433
- "responses": {
434
- "200": {
435
- "description": "Successful Response",
436
- "content": {
437
- "application/json": {
438
- "schema": {}
439
- }
440
- }
441
- },
442
- "422": {
443
- "description": "Validation Error",
444
- "content": {
445
- "application/json": {
446
- "schema": {
447
- "$ref": "#/components/schemas/HTTPValidationError"
448
- }
449
- }
450
- }
451
- }
452
- }
453
- }
454
- }
455
- },
456
- "components": {
457
- "schemas": {
458
- "CreateSessionRequest": {
459
- "properties": {
460
- "session_id": {
461
- "type": "string",
462
- "title": "Session Id"
463
- },
464
- "policy_path": {
465
- "type": "string",
466
- "title": "Policy Path"
467
- },
468
- "camera_names": {
469
- "items": {
470
- "type": "string"
471
- },
472
- "type": "array",
473
- "title": "Camera Names",
474
- "default": [
475
- "front"
476
- ]
477
- },
478
- "arena_server_url": {
479
- "type": "string",
480
- "title": "Arena Server Url",
481
- "default": "http://localhost:8000"
482
- },
483
- "workspace_id": {
484
- "anyOf": [
485
- {
486
- "type": "string"
487
- },
488
- {
489
- "type": "null"
490
- }
491
- ],
492
- "title": "Workspace Id"
493
- }
494
- },
495
- "type": "object",
496
- "required": [
497
- "session_id",
498
- "policy_path"
499
- ],
500
- "title": "CreateSessionRequest"
501
- },
502
- "CreateSessionResponse": {
503
- "properties": {
504
- "workspace_id": {
505
- "type": "string",
506
- "title": "Workspace Id"
507
- },
508
- "camera_room_ids": {
509
- "additionalProperties": {
510
- "type": "string"
511
- },
512
- "type": "object",
513
- "title": "Camera Room Ids"
514
- },
515
- "joint_input_room_id": {
516
- "type": "string",
517
- "title": "Joint Input Room Id"
518
- },
519
- "joint_output_room_id": {
520
- "type": "string",
521
- "title": "Joint Output Room Id"
522
- }
523
- },
524
- "type": "object",
525
- "required": [
526
- "workspace_id",
527
- "camera_room_ids",
528
- "joint_input_room_id",
529
- "joint_output_room_id"
530
- ],
531
- "title": "CreateSessionResponse"
532
- },
533
- "HTTPValidationError": {
534
- "properties": {
535
- "detail": {
536
- "items": {
537
- "$ref": "#/components/schemas/ValidationError"
538
- },
539
- "type": "array",
540
- "title": "Detail"
541
- }
542
- },
543
- "type": "object",
544
- "title": "HTTPValidationError"
545
- },
546
- "SessionStatusResponse": {
547
- "properties": {
548
- "session_id": {
549
- "type": "string",
550
- "title": "Session Id"
551
- },
552
- "status": {
553
- "type": "string",
554
- "title": "Status"
555
- },
556
- "policy_path": {
557
- "type": "string",
558
- "title": "Policy Path"
559
- },
560
- "camera_names": {
561
- "items": {
562
- "type": "string"
563
- },
564
- "type": "array",
565
- "title": "Camera Names"
566
- },
567
- "workspace_id": {
568
- "type": "string",
569
- "title": "Workspace Id"
570
- },
571
- "rooms": {
572
- "additionalProperties": true,
573
- "type": "object",
574
- "title": "Rooms"
575
- },
576
- "stats": {
577
- "additionalProperties": true,
578
- "type": "object",
579
- "title": "Stats"
580
- },
581
- "inference_stats": {
582
- "anyOf": [
583
- {
584
- "additionalProperties": true,
585
- "type": "object"
586
- },
587
- {
588
- "type": "null"
589
- }
590
- ],
591
- "title": "Inference Stats"
592
- },
593
- "error_message": {
594
- "anyOf": [
595
- {
596
- "type": "string"
597
- },
598
- {
599
- "type": "null"
600
- }
601
- ],
602
- "title": "Error Message"
603
- }
604
- },
605
- "type": "object",
606
- "required": [
607
- "session_id",
608
- "status",
609
- "policy_path",
610
- "camera_names",
611
- "workspace_id",
612
- "rooms",
613
- "stats"
614
- ],
615
- "title": "SessionStatusResponse"
616
- },
617
- "ValidationError": {
618
- "properties": {
619
- "loc": {
620
- "items": {
621
- "anyOf": [
622
- {
623
- "type": "string"
624
- },
625
- {
626
- "type": "integer"
627
- }
628
- ]
629
- },
630
- "type": "array",
631
- "title": "Location"
632
- },
633
- "msg": {
634
- "type": "string",
635
- "title": "Message"
636
- },
637
- "type": {
638
- "type": "string",
639
- "title": "Error Type"
640
- }
641
- },
642
- "type": "object",
643
- "required": [
644
- "loc",
645
- "msg",
646
- "type"
647
- ],
648
- "title": "ValidationError"
649
- }
650
- },
651
- "securitySchemes": {
652
- "BearerAuth": {
653
- "type": "http",
654
- "scheme": "bearer",
655
- "bearerFormat": "JWT"
656
- },
657
- "ApiKeyAuth": {
658
- "type": "apiKey",
659
- "in": "header",
660
- "name": "X-API-Key"
661
- }
662
- }
663
- },
664
- "servers": [
665
- {
666
- "url": "http://localhost:8001",
667
- "description": "Development server"
668
- },
669
- {
670
- "url": "https://your-production-server.com",
671
- "description": "Production server"
672
- }
673
- ],
674
- "tags": [
675
- {
676
- "name": "Health",
677
- "description": "Health check and server status endpoints"
678
- },
679
- {
680
- "name": "Sessions",
681
- "description": "Inference session management - create, control, and monitor AI sessions"
682
- },
683
- {
684
- "name": "Control",
685
- "description": "Session control operations - start, stop, restart inference"
686
- },
687
- {
688
- "name": "Debug",
689
- "description": "Debug and monitoring endpoints for system diagnostics"
690
- }
691
- ]
692
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pyproject.toml CHANGED
@@ -15,7 +15,7 @@ dependencies = [
15
  "huggingface-hub>=0.32.4",
16
  "imageio[ffmpeg]>=2.37.0",
17
  "lerobot",
18
- "robohub-transport-server-client",
19
  "numpy>=1.26.4",
20
  "opencv-python>=4.11.0.86",
21
  "opencv-python-headless>=4.11.0.86",
@@ -39,5 +39,5 @@ dev = [
39
  ]
40
 
41
  [tool.uv.sources]
42
- robohub-transport-server-client = { path = "../transport-server/client/python", editable = true }
43
  lerobot = { path = "./external/lerobot", editable = false }
 
15
  "huggingface-hub>=0.32.4",
16
  "imageio[ffmpeg]>=2.37.0",
17
  "lerobot",
18
+ "robothub-transport-server-client",
19
  "numpy>=1.26.4",
20
  "opencv-python>=4.11.0.86",
21
  "opencv-python-headless>=4.11.0.86",
 
39
  ]
40
 
41
  [tool.uv.sources]
42
+ robothub_transport_server_client = { path = "./external/RobotHub-TransportServer/client/python", editable = true }
43
  lerobot = { path = "./external/lerobot", editable = false }
src/inference_server.egg-info/PKG-INFO CHANGED
@@ -14,7 +14,7 @@ Requires-Dist: httpx>=0.28.1
14
  Requires-Dist: huggingface-hub>=0.32.4
15
  Requires-Dist: imageio[ffmpeg]>=2.37.0
16
  Requires-Dist: lerobot
17
- Requires-Dist: lerobot-arena-client
18
  Requires-Dist: numpy>=1.26.4
19
  Requires-Dist: opencv-python>=4.11.0.86
20
  Requires-Dist: opencv-python-headless>=4.11.0.86
 
14
  Requires-Dist: huggingface-hub>=0.32.4
15
  Requires-Dist: imageio[ffmpeg]>=2.37.0
16
  Requires-Dist: lerobot
17
+ Requires-Dist: robohub-transport-server-client
18
  Requires-Dist: numpy>=1.26.4
19
  Requires-Dist: opencv-python>=4.11.0.86
20
  Requires-Dist: opencv-python-headless>=4.11.0.86
src/inference_server.egg-info/requires.txt CHANGED
@@ -8,7 +8,7 @@ httpx>=0.28.1
8
  huggingface-hub>=0.32.4
9
  imageio[ffmpeg]>=2.37.0
10
  lerobot
11
- lerobot-arena-client
12
  numpy>=1.26.4
13
  opencv-python>=4.11.0.86
14
  opencv-python-headless>=4.11.0.86
 
8
  huggingface-hub>=0.32.4
9
  imageio[ffmpeg]>=2.37.0
10
  lerobot
11
+ robohub-transport-server-client
12
  numpy>=1.26.4
13
  opencv-python>=4.11.0.86
14
  opencv-python-headless>=4.11.0.86
src/inference_server/__pycache__/session_manager.cpython-312.pyc CHANGED
Binary files a/src/inference_server/__pycache__/session_manager.cpython-312.pyc and b/src/inference_server/__pycache__/session_manager.cpython-312.pyc differ
 
src/inference_server/__pycache__/session_manager.cpython-313.pyc CHANGED
Binary files a/src/inference_server/__pycache__/session_manager.cpython-313.pyc and b/src/inference_server/__pycache__/session_manager.cpython-313.pyc differ
 
src/inference_server/session_manager.py CHANGED
@@ -5,8 +5,8 @@ import time
5
  from collections import deque
6
 
7
  import numpy as np
8
- from robohub_transport_server_client import RoboticsConsumer, RoboticsProducer
9
- from robohub_transport_server_client.video import VideoConsumer, VideoProducer
10
 
11
  from inference_server.models import get_inference_engine, list_supported_policies
12
  from inference_server.models.joint_config import JointConfig
 
5
  from collections import deque
6
 
7
  import numpy as np
8
+ from transport_server_client import RoboticsConsumer, RoboticsProducer
9
+ from transport_server_client.video import VideoConsumer, VideoProducer
10
 
11
  from inference_server.models import get_inference_engine, list_supported_policies
12
  from inference_server.models.joint_config import JointConfig
test_integration.py DELETED
@@ -1,140 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Test script for the integrated Inference Server setup
4
-
5
- This script verifies that both the FastAPI API and Gradio UI work correctly.
6
- """
7
-
8
- import asyncio
9
- import sys
10
- import time
11
- from pathlib import Path
12
-
13
- import httpx
14
-
15
- # Add src to path
16
- src_path = Path(__file__).parent / "src"
17
- sys.path.insert(0, str(src_path))
18
-
19
-
20
- async def test_api_endpoints():
21
- """Test that the FastAPI endpoints work correctly."""
22
- base_url = "http://localhost:7860"
23
-
24
- async with httpx.AsyncClient(timeout=10.0) as client:
25
- try:
26
- # Test main health endpoint
27
- print("🔍 Testing main health endpoint...")
28
- response = await client.get(f"{base_url}/api/health")
29
- assert response.status_code == 200
30
- data = response.json()
31
- print(f"✅ Health check passed: {data}")
32
-
33
- # Test API docs availability
34
- print("📖 Testing API docs availability...")
35
- response = await client.get(f"{base_url}/api/docs")
36
- assert response.status_code == 200
37
- print("✅ API docs available")
38
-
39
- # Test OpenAPI schema
40
- print("📋 Testing OpenAPI schema...")
41
- response = await client.get(f"{base_url}/api/openapi.json")
42
- assert response.status_code == 200
43
- schema = response.json()
44
- print(f"✅ OpenAPI schema available: {schema['info']['title']}")
45
-
46
- # Test sessions endpoint
47
- print("📝 Testing sessions endpoint...")
48
- response = await client.get(f"{base_url}/api/sessions")
49
- assert response.status_code == 200
50
- sessions = response.json()
51
- print(f"✅ Sessions endpoint works: {len(sessions)} sessions")
52
-
53
- # Test Gradio UI availability
54
- print("🎨 Testing Gradio UI availability...")
55
- response = await client.get(f"{base_url}/")
56
- assert response.status_code == 200
57
- print("✅ Gradio UI available")
58
-
59
- print("\n🎉 All tests passed! The integrated setup is working correctly.")
60
- return True
61
-
62
- except Exception as e:
63
- print(f"❌ Test failed: {e}")
64
- return False
65
-
66
-
67
- async def test_session_creation():
68
- """Test creating a session through the API."""
69
- base_url = "http://localhost:7860"
70
-
71
- async with httpx.AsyncClient(timeout=30.0) as client:
72
- try:
73
- # Create a test session
74
- print("🔧 Testing session creation...")
75
-
76
- session_data = {
77
- "session_id": "test-session",
78
- "policy_path": "./checkpoints/act_so101_beyond",
79
- "camera_names": ["front"],
80
- "arena_server_url": "http://localhost:8000",
81
- }
82
-
83
- response = await client.post(f"{base_url}/api/sessions", json=session_data)
84
-
85
- if response.status_code == 200:
86
- print("✅ Session creation successful")
87
- return True
88
- print(
89
- f"⚠️ Session creation failed (expected if no model exists): {response.status_code}"
90
- )
91
- return True # This is expected if no model exists
92
-
93
- except Exception as e:
94
- print(f"⚠️ Session creation test failed (expected if no model exists): {e}")
95
- return True # This is expected if no model exists
96
-
97
-
98
- def print_integration_info():
99
- """Print information about the integrated setup."""
100
- print("=" * 60)
101
- print("🤖 Integrated Inference Server Test Results")
102
- print("=" * 60)
103
- print()
104
- print("📍 Access Points:")
105
- print(" 🎨 Gradio UI: http://localhost:7860/")
106
- print(" 📖 API Docs: http://localhost:7860/api/docs")
107
- print(" 🔄 Health Check: http://localhost:7860/api/health")
108
- print(" 📋 OpenAPI Schema: http://localhost:7860/api/openapi.json")
109
- print(" 📝 Sessions API: http://localhost:7860/api/sessions")
110
- print()
111
- print("🔧 Features Available:")
112
- print(" ✅ Direct session management through UI")
113
- print(" ✅ Full REST API for programmatic access")
114
- print(" ✅ Interactive API documentation")
115
- print(" ✅ Single port deployment")
116
- print(" ✅ CORS enabled for frontend integration")
117
- print()
118
-
119
-
120
- if __name__ == "__main__":
121
- print("🧪 Testing Integrated Inference Server Setup")
122
- print("Make sure the server is running with: python launch_simple.py")
123
- print()
124
-
125
- # Wait a moment for server to be ready
126
- time.sleep(2)
127
-
128
- # Run tests
129
- try:
130
- success = asyncio.run(test_api_endpoints())
131
- if success:
132
- asyncio.run(test_session_creation())
133
-
134
- print_integration_info()
135
-
136
- except KeyboardInterrupt:
137
- print("\n🛑 Tests interrupted by user")
138
- except Exception as e:
139
- print(f"❌ Test runner error: {e}")
140
- sys.exit(1)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
uv.lock CHANGED
@@ -1125,7 +1125,7 @@ dependencies = [
1125
  { name = "psutil" },
1126
  { name = "pydantic" },
1127
  { name = "python-multipart" },
1128
- { name = "robohub-transport-server-client" },
1129
  { name = "torch" },
1130
  { name = "torchvision" },
1131
  { name = "tqdm" },
@@ -1160,7 +1160,7 @@ requires-dist = [
1160
  { name = "psutil", specifier = ">=7.0.0" },
1161
  { name = "pydantic", specifier = ">=2.11.5" },
1162
  { name = "python-multipart", specifier = ">=0.0.20" },
1163
- { name = "robohub-transport-server-client", editable = "../transport-server/client/python" },
1164
  { name = "torch", specifier = ">=2.2.2" },
1165
  { name = "torchvision", specifier = ">=0.17.2" },
1166
  { name = "tqdm", specifier = ">=4.67.1" },
@@ -2566,9 +2566,9 @@ wheels = [
2566
  ]
2567
 
2568
  [[package]]
2569
- name = "robohub-transport-server-client"
2570
  version = "1.0.0"
2571
- source = { editable = "../transport-server/client/python" }
2572
  dependencies = [
2573
  { name = "aiohttp" },
2574
  { name = "aiortc" },
 
1125
  { name = "psutil" },
1126
  { name = "pydantic" },
1127
  { name = "python-multipart" },
1128
+ { name = "robothub-transport-server-client" },
1129
  { name = "torch" },
1130
  { name = "torchvision" },
1131
  { name = "tqdm" },
 
1160
  { name = "psutil", specifier = ">=7.0.0" },
1161
  { name = "pydantic", specifier = ">=2.11.5" },
1162
  { name = "python-multipart", specifier = ">=0.0.20" },
1163
+ { name = "robothub-transport-server-client", editable = "external/RobotHub-TransportServer/client/python" },
1164
  { name = "torch", specifier = ">=2.2.2" },
1165
  { name = "torchvision", specifier = ">=0.17.2" },
1166
  { name = "tqdm", specifier = ">=4.67.1" },
 
2566
  ]
2567
 
2568
  [[package]]
2569
+ name = "robothub-transport-server-client"
2570
  version = "1.0.0"
2571
+ source = { editable = "external/RobotHub-TransportServer/client/python" }
2572
  dependencies = [
2573
  { name = "aiohttp" },
2574
  { name = "aiortc" },