Skip to content

Commit 67f3516

Browse files
authored
Merge branch 'main' into add_molecule_task
2 parents 5d04862 + 7546e30 commit 67f3516

File tree

5 files changed

+60
-17
lines changed

5 files changed

+60
-17
lines changed

packages/tasks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@huggingface/tasks",
33
"packageManager": "[email protected]",
4-
"version": "0.19.7",
4+
"version": "0.19.8",
55
"description": "List of ML tasks for huggingface.co/tasks",
66
"repository": "https://github.com/huggingface/huggingface.js.git",
77
"publishConfig": {

packages/tasks/src/model-libraries.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,14 @@ export const MODEL_LIBRARIES_UI_ELEMENTS = {
940940
filter: true,
941941
countDownloads: `path:"pytorch_model.bin" OR path:"model.safetensors"`,
942942
},
943+
torchgeo: {
944+
prettyLabel: "TorchGeo",
945+
repoName: "TorchGeo",
946+
repoUrl: "https://github.com/microsoft/torchgeo",
947+
docsUrl: "https://torchgeo.readthedocs.io/",
948+
filter: false,
949+
countDownloads: `path_extension:"pt" OR path_extension:"pth"`,
950+
},
943951
transformers: {
944952
prettyLabel: "Transformers",
945953
repoName: "🤗/transformers",

packages/tiny-agents/README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pnpm add @huggingface/tiny-agents
1616

1717
```bash
1818
npx @huggingface/tiny-agents [command] "agent/id"
19-
2019
```
2120

2221
```
@@ -41,8 +40,8 @@ touch my-agent/agent.json
4140

4241
```json
4342
{
44-
"model": "Qwen/Qwen2.5-72B-Instruct", // model id
45-
"provider": "nebius", // or you can also use a local endpoint base url with `endpointUrl`
43+
"model": "Qwen/Qwen2.5-72B-Instruct",
44+
"provider": "nebius",
4645
"servers": [
4746
{
4847
"type": "stdio",
@@ -55,6 +54,25 @@ touch my-agent/agent.json
5554
}
5655
```
5756

57+
Or using a local or remote endpoint URL:
58+
59+
```json
60+
{
61+
"model": "Qwen/Qwen3-32B",
62+
"endpointUrl": "http://localhost:1234/v1",
63+
"servers": [
64+
{
65+
"type": "stdio",
66+
"config": {
67+
"command": "npx",
68+
"args": ["@playwright/mcp@latest"]
69+
}
70+
}
71+
]
72+
}
73+
74+
```
75+
5876
Where `servers` is a list of MCP servers (we support Stdio, SSE, and HTTP servers).
5977

6078
Optionally, you can add a `PROMPT.md` file to override the default Agent prompt.

packages/tiny-agents/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@huggingface/tiny-agents",
33
"packageManager": "[email protected]",
4-
"version": "0.2.2",
4+
"version": "0.2.3",
55
"description": "Lightweight, composable agents for AI applications",
66
"repository": "https://github.com/huggingface/huggingface.js.git",
77
"publishConfig": {

packages/tiny-agents/src/cli.ts

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,17 @@ async function main() {
114114

115115
const { configJson, prompt } = await loadConfigFrom(loadFrom);
116116

117-
const ConfigSchema = z.object({
118-
model: z.string(),
119-
provider: z.enum(PROVIDERS_OR_POLICIES),
120-
servers: z.array(ServerConfigSchema),
121-
});
117+
const ConfigSchema = z
118+
.object({
119+
model: z.string(),
120+
provider: z.enum(PROVIDERS_OR_POLICIES).optional(),
121+
endpointUrl: z.string().optional(),
122+
apiKey: z.string().optional(),
123+
servers: z.array(ServerConfigSchema),
124+
})
125+
.refine((data) => data.provider !== undefined || data.endpointUrl !== undefined, {
126+
message: "At least one of 'provider' or 'endpointUrl' is required",
127+
});
122128

123129
let config: z.infer<typeof ConfigSchema>;
124130
try {
@@ -129,13 +135,24 @@ async function main() {
129135
process.exit(1);
130136
}
131137

132-
const agent = new Agent({
133-
provider: config.provider,
134-
model: config.model,
135-
apiKey: process.env.HF_TOKEN ?? "",
136-
servers: config.servers,
137-
prompt,
138-
});
138+
const agent = new Agent(
139+
config.endpointUrl
140+
? {
141+
endpointUrl: config.endpointUrl,
142+
model: config.model,
143+
apiKey: config.apiKey ?? process.env.API_KEY ?? process.env.HF_TOKEN,
144+
servers: config.servers,
145+
prompt,
146+
}
147+
: {
148+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
149+
provider: config.provider!,
150+
model: config.model,
151+
apiKey: config.apiKey ?? process.env.API_KEY ?? process.env.HF_TOKEN,
152+
servers: config.servers,
153+
prompt,
154+
}
155+
);
139156

140157
if (command === "serve") {
141158
error(`Serve is not implemented yet, coming soon!`);

0 commit comments

Comments
 (0)