Trisha Tomy commited on
Commit
87d0980
·
2 Parent(s): 689e710 94606b3
Files changed (2) hide show
  1. .gitattributes +35 -0
  2. README.md +10 -274
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,274 +1,10 @@
1
- <div align="center">
2
-
3
- <img src="assets/proxy-lite.png" alt="Proxy Lite logo" width="600" height="auto" style="margin-bottom: 20px;" />
4
-
5
- <h2>
6
- A mini, open-weights, version of <a href="https://proxy.convergence.ai">Proxy</a>.
7
- </h2>
8
-
9
-
10
- <!-- Badges -->
11
- <p>
12
- <a href="https://github.com/convergence-ai/proxy-lite/contributors">
13
- <img src="https://img.shields.io/github/contributors/convergence-ai/proxy-lite" alt="contributors" />
14
- </a>
15
- <a href="">
16
- <img src="https://img.shields.io/github/last-commit/convergence-ai/proxy-lite" alt="last update" />
17
- </a>
18
- <a href="https://github.com/convergence-ai/proxy-lite/network/members">
19
- <img src="https://img.shields.io/github/forks/convergence-ai/proxy-lite" alt="forks" />
20
- </a>
21
- <a href="https://github.com/convergence-ai/proxy-lite/stargazers">
22
- <img src="https://img.shields.io/github/stars/convergence-ai/proxy-lite" alt="stars" />
23
- </a>
24
- <a href="https://github.com/convergence-ai/proxy-lite/issues/">
25
- <img src="https://img.shields.io/github/issues/convergence-ai/proxy-lite" alt="open issues" />
26
- </a>
27
- </p>
28
-
29
- </div>
30
-
31
-
32
-
33
-
34
- <div align="center">
35
- <img src="assets/demo.gif" alt="Proxy Lite Demo" />
36
- </div>
37
-
38
-
39
-
40
- ## Installation
41
-
42
- Clone the repository:
43
-
44
- ```bash
45
- git clone https://github.com/convergence-ai/proxy-lite.git
46
- ```
47
-
48
- Set-up the environment with:
49
-
50
- ```bash
51
- make proxy
52
- ```
53
-
54
- Or do it manually:
55
-
56
- ```bash
57
- pip install uv
58
- uv venv --python 3.11 --python-preference managed
59
- uv sync
60
- uv pip install -e .
61
- playwright install
62
- ```
63
-
64
-
65
- ## Usage
66
-
67
- ```bash
68
- proxy --help
69
- ```
70
- You can directly run Proxy Lite on a task with:
71
-
72
- ```bash
73
- proxy "Find some markets near Kings Cross and tell me their ratings."
74
- ```
75
-
76
- Alternatively you can run the local web ui with:
77
-
78
- ```bash
79
- make app
80
- ```
81
-
82
- ### Proxy Lite Endpoint
83
-
84
- By default, Proxy Lite will point to an endpoint set up on HuggingFace spaces.
85
- > ❗ This is a demo endpoint and is not suitable for production, or even frequent hobbyist, use; it may be very slow when under even moderate load.
86
-
87
- We recommend hosting your own endpoint with vLLM, you can use the following command:
88
-
89
- ```bash
90
- vllm serve convergence-ai/proxy-lite-3b \
91
- --trust-remote-code \
92
- --enable-auto-tool-choice \
93
- --tool-call-parser hermes \
94
- --port 8008 \
95
- ```
96
-
97
- The tool arguments are **very important** for parsing the tool calls from the model appropriately.
98
-
99
- > **Important:** To serve the model locally, install vLLM and transformers with `uv sync --all-extras`. Qwen-2.5-VL support is not yet available in the latest release of `transformers` so installation from source is required (the appropriate revision is specified in the `pyproject.toml` file).
100
-
101
- You can set the `api_base` to point to your local endpoint when calling Proxy Lite:
102
-
103
- ```bash
104
- proxy --api-base http://localhost:8008/v1 "Book a table...
105
- ```
106
- or by setting the environment variable:
107
-
108
- ```bash
109
- export PROXY_LITE_API_BASE=http://localhost:8008/v1
110
- ```
111
-
112
- ## Scaffolding Proxy Lite in Python
113
-
114
- If using the model outside the CLI or streamlit app, you can use the `Runner` class to launch the model in a web-browsing environment.
115
-
116
- The `RunnerConfig` is how you configure the system setup, including the model used.
117
- The library is designed to be modular and extendable, making it easy to swap out the environment, solver, or agent.
118
-
119
- Example:
120
- ```python
121
- import asyncio
122
- from proxy_lite import Runner, RunnerConfig
123
-
124
- config = RunnerConfig.from_dict(
125
- {
126
- "environment": {
127
- "name": "webbrowser",
128
- "homepage": "https://www.google.com",
129
- "headless": True, # Don't show the browser
130
- },
131
- "solver": {
132
- "name": "simple",
133
- "agent": {
134
- "name": "proxy_lite",
135
- "client": {
136
- "name": "convergence",
137
- "model_id": "convergence-ai/proxy-lite-3b",
138
- "api_base": "https://convergence-ai-demo-api.hf.space/v1",
139
- },
140
- },
141
- },
142
- "max_steps": 50,
143
- "action_timeout": 1800,
144
- "environment_timeout": 1800,
145
- "task_timeout": 18000,
146
- "logger_level": "DEBUG",
147
- },
148
- )
149
-
150
- proxy = Runner(config=config)
151
- result = asyncio.run(
152
- proxy.run("Book a table for 2 at an Italian restaurant in Kings Cross tonight at 7pm.")
153
- )
154
- ```
155
-
156
- The `Runner` sets the solver and environment off in a loop, like in a traditional reinforcement learning setup.
157
-
158
- <div align="center">
159
- <img src="assets/loop.png" alt="Runner Loop" width="800" height="auto" style="margin-bottom: 20px;" />
160
- </div>
161
-
162
-
163
- Proxy Lite expects the following message format:
164
-
165
- ```python
166
- message_history = [
167
- {
168
- "role": "system",
169
- "content": "You are Proxy Lite...", # Full system prompt in src/proxy_lite/agents/proxy_lite_agent.py
170
- }, # System prompt
171
- {
172
- "role": "user",
173
- "content": "Find some markets near Kings Cross and tell me their ratings.",
174
- }, # Set the task
175
- {
176
- "role": "user",
177
- "content": [
178
- {"type": "image_url", "image_url": {base64_encoded_screenshot} },
179
- {"type": "text", "text": "URL: https://www.google.com/ \n- [0] <a>About</a> \n- [1] <a>Store</a>...."}
180
- ] # This is the observation from the environment
181
- },
182
- ]
183
- ```
184
- This would then build up the message history, alternating between the assistant (who takes the *action*) and the user (who provides the *observation*).
185
-
186
- > **Context-Window Management:** When making calls to the model, all the observations other than the current one are discarded in order to reduce the large number of image tokens required. Since the model responses include reflection on the observations and are all included in the message history, the model is still aware of the entire history when planning new actions.
187
-
188
- You should also pass the `Tools` that the model has access to, these will define the action space available to the model. You can do this with `transformers`:
189
-
190
- ```python
191
- from qwen_vl_utils import process_vision_info
192
- from transformers import AutoProcessor
193
-
194
- from proxy_lite.tools import ReturnValueTool, BrowserTool
195
- from proxy_lite.serializer import OpenAICompatableSerializer
196
-
197
- processor = AutoProcessor.from_pretrained("convergence-ai/proxy-lite-3b")
198
- tools = OpenAICompatableSerializer().serialize_tools([ReturnValueTool(), BrowserTool(session=None)])
199
-
200
- templated_messages = processor.apply_chat_template(
201
- message_history, tokenize=False, add_generation_prompt=True, tools=tools
202
- )
203
-
204
- image_inputs, video_inputs = process_vision_info(message_history)
205
-
206
- batch = processor(
207
- text=[templated_messages],
208
- images=image_inputs,
209
- videos=video_inputs,
210
- padding=True,
211
- return_tensors="pt",
212
- )
213
- ```
214
-
215
- Or you can send to the endpoint directly, which will handle the formatting:
216
-
217
- ```python
218
- from openai import OpenAI
219
-
220
- client = OpenAI(base_url="http://convergence-ai-demo-api.hf.space/v1")
221
-
222
- response = client.chat.completions.create(
223
- model="convergence-ai/proxy-lite-3b",
224
- messages=message_history,
225
- tools=tools,
226
- tool_choice="auto",
227
- )
228
- ```
229
-
230
- The model's response will follow the format of:
231
- - Observe
232
- - Think
233
- - Act
234
- ```bash
235
- <observation>The privacy consent banner has been successfully dismissed, allowing full access to the webpage. The search bar is visible, and the page is ready for interaction.</observation>
236
- <thinking>The task of finding a vegetarian lasagna recipe has not yet been completed. I now have access to the search bar to begin searching for the recipe. I will type 'vegetarian lasagna' into the search bar and then click the search button to find relevant recipes.</thinking>
237
- <tool_call>{"function": "click", "arguments": {"entries": [{"mark_id": 1, "content": "vegetarian lasagna"}]}}</tool_call>
238
- ```
239
- Where steps are separated by `<observation>`, `<thinking>`, and `<tool_call>` tags (Use the `-tool-call-parser hermes` option with the vLLM server to automatically parse the tool call when getting back the completion).
240
-
241
-
242
-
243
-
244
- ### Webbrowser Environment
245
-
246
- The `webbrowser` environment is a simple environment that uses the `playwright` library to navigate the web.
247
-
248
- We launch a Chromium browser and navigate to the `homepage` provided in the `RunnerConfig`.
249
-
250
- Actions in an environment are defined through available tool calls, which in the browser case are set as default in the `BrowserTool` class. This allows the model to click, type, etc. at relevant `mark_id` elements on the page. These elements are extracted using JavaScript injected into the page in order to make interaction easier for the models.
251
-
252
- **Note:** We use `playwright_stealth` to lower the chance of detection by anti-bot services, but this isn't foolproof and Proxy Lite may still get blocked by captchas or other anti-bot measures, especially when using the `headless` flag. We recommend using network proxies to avoid this issue.
253
-
254
-
255
- ## Limitations
256
-
257
- This model has not been designed to act as a full assistant able to interact with a user, instead it acts as a tool that goes out and *autonomously* completes a task.
258
- As such, it will struggle with tasks that require credentials or user interaction such as actually purchasing items if you don't give all the required details in the prompt.
259
-
260
- ## Try Proxy
261
-
262
- Want to try out the full version of Proxy? Visit [proxy.convergence.ai](https://proxy.convergence.ai) to experience the complete, production-ready autonomous assistant with enhanced capabilities, improved reliability, and support for a wider range of tasks.
263
-
264
-
265
- ## Citation
266
-
267
- ```bibtex
268
- @article{proxy-lite,
269
- title={Proxy Lite - A Mini, Open-weights, Autonomous Assistant},
270
- author={Convergence AI},
271
- url={https://github.com/convergence-ai/proxy-lite},
272
- year={2025}
273
- }
274
- ```
 
1
+ ---
2
+ title: Proxy Lite Demo For Setup
3
+ emoji: 😻
4
+ colorFrom: indigo
5
+ colorTo: gray
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference