Skip to content

Commit 2ec407b

Browse files
committed
feat(alice-runtime): update dependencies in Cargo.toml for version 0.1.2
1 parent 5f9c5c0 commit 2ec407b

6 files changed

Lines changed: 56 additions & 19 deletions

File tree

Cargo.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace.package]
2-
version = "0.1.1"
2+
version = "0.1.2"
33
edition = "2024"
44
license = "Apache-2.0"
55
authors = ["Bob Liu <akagi201@gmail.com>"]
@@ -15,28 +15,29 @@ resolver = "3"
1515

1616
[workspace.dependencies]
1717
# local crates
18-
alice-adapters = { path = "crates/alice-adapters", version = "0.1.1" }
19-
alice-cli = { path = "crates/alice-cli", version = "0.1.1" }
20-
alice-core = { path = "crates/alice-core", version = "0.1.1" }
21-
alice-runtime = { path = "crates/alice-runtime", version = "0.1.1" }
18+
alice-adapters = { path = "crates/alice-adapters", version = "0.1.2" }
19+
alice-cli = { path = "crates/alice-cli", version = "0.1.2" }
20+
alice-core = { path = "crates/alice-core", version = "0.1.2" }
21+
alice-runtime = { path = "crates/alice-runtime", version = "0.1.2" }
2222

2323
# external crates
2424
agent-client-protocol = "0.10.3"
2525
async-trait = "0.1.89"
26-
bob-adapters = "0.3.0"
27-
bob-chat = "0.3.0"
28-
bob-core = "0.3.0"
29-
bob-runtime = "0.3.0"
30-
bob-skills = "0.3.0"
26+
bob-adapters = "0.3.1"
27+
bob-chat = "0.3.1"
28+
bob-core = "0.3.1"
29+
bob-runtime = "0.3.1"
30+
bob-skills = "0.3.1"
3131
clap = "4.6.0"
3232
config = "0.15.22"
3333
eyre = "0.6.12"
3434
futures-util = "0.3.32"
35+
liter-llm = "1.1.1"
3536
parking_lot = "0.12.5"
3637
rusqlite = "0.39.0"
3738
serde = "1.0.228"
3839
serde_json = "1.0.149"
39-
sqlite-vec = "0.1.7"
40+
sqlite-vec = "0.1.8"
4041
thiserror = "2.0.18"
4142
tokio = "1.50.0"
4243
tokio-util = "0.7.18"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Alice supports two agent backends, selectable via configuration:
4949

5050
| Backend | Description | Use Case |
5151
|---------|-------------|----------|
52-
| `bob` (default) | Built-in Bob runtime with genai LLM adapter and MCP tools | Self-contained agent, no external process needed |
52+
| `bob` (default) | Built-in Bob runtime with liter-llm adapter and MCP tools | Self-contained agent, no external process needed |
5353
| `acp` | Delegates to an external agent via [Agent Client Protocol](https://agentclientprotocol.com) | Use any ACP-compatible agent (OpenCode, Claude Code, Codex, etc.) |
5454

5555
### Agent Client Protocol (ACP)

crates/alice-runtime/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ bob-skills.workspace = true
2929
config.workspace = true
3030
eyre.workspace = true
3131
futures-util = { workspace = true }
32+
liter-llm.workspace = true
3233
serde = { workspace = true, features = ["derive"] }
3334
tokio = { workspace = true, features = [
3435
"macros",

crates/alice-runtime/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This crate is the composition root that wires all components together:
99
- **Configuration** — TOML-based config with `alice.toml` via the `config` crate
1010
- **Bootstrap** — builds the full runtime context from configuration
1111
- **Agent backends** — pluggable `AgentBackend` trait with two implementations:
12-
- `BobAgentBackend` — built-in Bob runtime with genai LLM adapter
12+
- `BobAgentBackend` — built-in Bob runtime with liter-llm adapter
1313
- `AcpAgentBackend` — external agent via Agent Client Protocol (feature-gated)
1414
- **Chat adapter runner** — event loop for CLI, Discord, and Telegram channels
1515
- **Skill system** — dynamic SKILL.md loading and per-turn skill injection

crates/alice-runtime/src/bootstrap.rs

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::sync::Arc;
55
use alice_adapters::memory::sqlite_store::SqliteMemoryStore;
66
use alice_core::memory::{domain::HybridWeights, service::MemoryService};
77
use bob_adapters::{
8-
llm_genai::GenAiLlmAdapter, mcp_rmcp::McpToolAdapter, observe::TracingEventSink,
8+
llm_liter::LiterLlmAdapter, mcp_rmcp::McpToolAdapter, observe::TracingEventSink,
99
store_memory::InMemorySessionStore, tape_memory::InMemoryTapeStore,
1010
};
1111
use bob_core::ports::{EventSink, LlmPort, SessionStore, TapeStorePort, ToolPort};
@@ -24,13 +24,28 @@ const DEFAULT_MAX_STEPS: u32 = 12;
2424
const DEFAULT_TURN_TIMEOUT_MS: u64 = 90_000;
2525
const DEFAULT_TOOL_TIMEOUT_MS: u64 = 15_000;
2626

27+
/// Convert a model identifier from the `provider:model` format (used by the
28+
/// bob runtime config) to the `provider/model` format expected by `liter_llm`.
29+
fn normalize_model_name(model: &str) -> String {
30+
if let Some((provider, rest)) = model.split_once(':') {
31+
format!("{provider}/{rest}")
32+
} else {
33+
model.to_string()
34+
}
35+
}
36+
2737
/// Build runtime context from configuration.
2838
///
2939
/// # Errors
3040
///
3141
/// Returns an error if any adapter fails to initialize.
3242
pub async fn build_runtime(cfg: &AliceConfig) -> eyre::Result<AliceRuntimeContext> {
33-
let llm: Arc<dyn LlmPort> = Arc::new(GenAiLlmAdapter::new(Default::default()));
43+
let default_model = normalize_model_name(&cfg.runtime.default_model);
44+
45+
let config = liter_llm::ClientConfig::new("");
46+
let client = liter_llm::DefaultClient::new(config, None)
47+
.map_err(|e| eyre::eyre!("failed to create liter-llm client: {e}"))?;
48+
let llm: Arc<dyn LlmPort> = Arc::new(LiterLlmAdapter::new(Arc::new(client)));
3449
let tools = build_tool_port(cfg).await?;
3550
let tools_ref = tools.clone();
3651
let store: Arc<dyn SessionStore> = Arc::new(InMemorySessionStore::new());
@@ -49,7 +64,7 @@ pub async fn build_runtime(cfg: &AliceConfig) -> eyre::Result<AliceRuntimeContex
4964
.with_tools(tools)
5065
.with_store(store.clone())
5166
.with_events(events.clone())
52-
.with_default_model(cfg.runtime.default_model.clone())
67+
.with_default_model(default_model.clone())
5368
.with_policy(policy)
5469
.with_dispatch_mode(resolve_dispatch_mode(cfg.runtime.dispatch_mode))
5570
.build()?;
@@ -88,7 +103,7 @@ pub async fn build_runtime(cfg: &AliceConfig) -> eyre::Result<AliceRuntimeContex
88103
memory_service,
89104
skill_composer,
90105
skill_token_budget: cfg.skills.token_budget,
91-
default_model: cfg.runtime.default_model.clone(),
106+
default_model,
92107
})
93108
}
94109

@@ -208,7 +223,7 @@ mod tests {
208223
let built = build_runtime(&cfg).await;
209224
assert!(built.is_ok(), "runtime should build without mcp");
210225
let Ok(built) = built else { return };
211-
assert_eq!(built.default_model, "openai:gpt-4o-mini");
226+
assert_eq!(built.default_model, "openai/gpt-4o-mini");
212227
}
213228

214229
#[tokio::test]
@@ -244,4 +259,24 @@ mod tests {
244259
);
245260
assert_eq!(resolve_dispatch_mode(None), DispatchMode::NativePreferred);
246261
}
262+
263+
#[test]
264+
fn normalize_model_name_converts_colon_to_slash() {
265+
assert_eq!(normalize_model_name("openai:gpt-4o-mini"), "openai/gpt-4o-mini");
266+
assert_eq!(
267+
normalize_model_name("anthropic:claude-sonnet-4-20250514"),
268+
"anthropic/claude-sonnet-4-20250514"
269+
);
270+
assert_eq!(normalize_model_name("groq:llama3-70b"), "groq/llama3-70b");
271+
}
272+
273+
#[test]
274+
fn normalize_model_name_preserves_slash_format() {
275+
assert_eq!(normalize_model_name("openai/gpt-4o-mini"), "openai/gpt-4o-mini");
276+
}
277+
278+
#[test]
279+
fn normalize_model_name_preserves_bare_model() {
280+
assert_eq!(normalize_model_name("gpt-4o-mini"), "gpt-4o-mini");
281+
}
247282
}

specs/2026-02-28-01-alice-hexagonal-agent/design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ CLI subcommands (run / chat / channel)
9595
| `InMemoryTapeStore` | `bob-adapters::tape_memory` | `scc::HashMap`-backed tape store |
9696
| `CompositeToolPort` | `bob-runtime::composite` | Multi-namespace tool composition |
9797
| `RuntimeBuilder` | `bob-runtime` | LLM/tools/store/events -> `AgentRuntime` |
98-
| `GenAiLlmAdapter` | `bob-adapters::llm_genai` | LLM provider adapter |
98+
| `LiterLlmAdapter` | `bob-adapters::llm_liter` | LLM provider adapter |
9999
| `McpToolAdapter` | `bob-adapters::mcp_rmcp` | MCP stdio tool servers |
100100
| `TracingEventSink` | `bob-adapters::observe` | Event observability |
101101
| `InMemorySessionStore` | `bob-adapters::store_memory` | Session state |

0 commit comments

Comments
 (0)