clawft-llm 0.6.4

LLM provider abstraction for clawft (OpenAI-compatible + native providers)
Documentation

LLM provider abstraction for clawft.

This crate provides a unified interface for calling LLM APIs via OpenAI-compatible endpoints. It is a standalone library with no dependencies on other clawft crates.

Architecture

  • [Provider] trait defines the chat completion interface
  • [OpenAiCompatProvider] implements it for any OpenAI-compatible API
  • [ProviderRouter] routes model names (e.g. "openai/gpt-4o") to providers
  • [LlmProviderConfig] describes how to connect to a provider

Quick Start

use clawft_llm::{ProviderRouter, ChatRequest, ChatMessage};

let router = ProviderRouter::with_builtins();
let (provider, model_name) = router.route("openai/gpt-4o").unwrap();

let request = ChatRequest::new(model_name, vec![
    ChatMessage::system("You are a helpful assistant."),
    ChatMessage::user("What is Rust?"),
]);

let response = provider.complete(&request).await?;
println!("{}", response.choices[0].message.content);

Crate Ecosystem

WeftOS is built from these crates:

Crate Role
weftos Product facade -- re-exports kernel, core, types
clawft-kernel Kernel: processes, services, governance, mesh, ExoChain
clawft-core Agent framework: pipeline, context, tools, skills
clawft-types Shared type definitions
clawft-platform Platform abstraction (native/WASM/browser)
clawft-plugin Plugin SDK for tools, channels, and extensions
clawft-llm LLM provider abstraction (11 providers + local)
exo-resource-tree Hierarchical resource namespace with Merkle integrity

Source: https://github.com/weave-logic-ai/weftos