Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,42 +189,37 @@ project, for example:
- Use Ollama as the LLM provider:

```sh
ollama pull qwen3.5
ollama pull ornith
```

- Run YoMo server:

```
RUST_LOG=debug ./target/release/yomo serve
```sh
./target/release/yomo serve
```

- Initialize a Serverless LLM Tool project:

```
```sh
./target/release/yomo init
```

- Edit tool source:

```
vim ./app/src/app.ts
```
then edit `./app/src/app.ts` in the project.

- Run YoMo serverless tool:

```
RUST_LOG=debug ./target/release/yomo run --name get-weather ./app
```sh
./target/release/yomo run --name get-weather ./app
```

- Send an agent request:
- Send a request to the LLM agent:

```sh
curl \
--request POST \
--url http://127.0.0.1:9001/v1/chat/completions \
--header 'Content-Type: application/json' \
--data '{
"model": "qwen3.5",
"messages": [
{
"role": "user",
Expand All @@ -234,6 +229,18 @@ project, for example:
}'
```

- Send a request to the serverless function directly:

```sh
curl \
--request POST \
--url http://127.0.0.1:9001/tool/get-weather \
--header 'Content-Type: application/json' \
--data '{
"args":"{\"city\":\"London\"}"
}'
```


## License

Expand Down
118 changes: 0 additions & 118 deletions agent.template.yaml

This file was deleted.

7 changes: 1 addition & 6 deletions serverless/node/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"name": "yomo-serverless-node",
"version": "0.1.0",
"private": true,
"devDependencies": {
"@types/node": "^25.5.2",
"typescript": "^6.0.2",
"ts-json-schema-generator": "^2.9.0"
}
"private": true
}
39 changes: 19 additions & 20 deletions src/bin/yomo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,10 @@ async fn serve(opt: ServeOptions) -> Result<()> {
.await?,
);

if config.http_api.enable_tool_api {
app = app.nest("/tool", build_tool_api(connector).await?);
let mut tool_api_prefix = String::new();
if let Some(t) = config.http_api.tool_api_prefix {
tool_api_prefix = t.clone();
app = app.nest(&tool_api_prefix, build_tool_api(connector).await?);
}

app = app.layer(axum::middleware::from_fn_with_state(
Expand All @@ -255,25 +257,22 @@ async fn serve(opt: ServeOptions) -> Result<()> {
));

info!(
"start HTTP API server on {}:{} (LLM API {}, Model API {}, Tool API {})",
config.http_api.host,
config.http_api.port,
if llm_providers_enabled {
"enabled at /v1"
} else {
"disabled"
},
if model_api_enabled {
"enabled at /v1"
} else {
"disabled"
},
if config.http_api.enable_tool_api {
"enabled at /tool"
} else {
"disabled"
}
"start HTTP API server on {}:{}",
config.http_api.host, config.http_api.port,
);

if llm_providers_enabled {
info!("LLM providers enabled at /v1");
}

if model_api_enabled {
info!("Model API providers enabled at /v1");
}

if !tool_api_prefix.is_empty() {
info!("Tool API enabled at {}", tool_api_prefix);
}

let listener = TcpListener::bind((config.http_api.host.as_ref(), config.http_api.port)).await?;

select! {
Expand Down
6 changes: 2 additions & 4 deletions src/llm_provider/openai_compatible/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ fn map_openai_error(err: ClientError) -> ProviderError {
pub fn build_openai_compatible_provider(
params: &HashMap<String, String>,
) -> Result<OpenAICompatibleProvider, ConfigError> {
let api_key = params
.get("api_key")
.ok_or_else(|| ConfigError::InvalidProvider("api_key is required".to_string()))?;
let mut config = client::Config::new(api_key.to_string());
let api_key = params.get("api_key").cloned().unwrap_or_default();
let mut config = client::Config::new(api_key);
let model_id = params.get("model").cloned();
if let Some(base_url) = params.get("base_url") {
config = config.base_url(base_url.to_string());
Expand Down
Loading
Loading