Skip to content
Notifications
Clear all

Has anyone tried OpenClaw with non-OpenAI models?

3 Posts
3 Users
0 Reactions
2 Views
(@briank)
Estimable Member
Joined: 6 days ago
Posts: 83
Topic starter   [#15393]

I’ve been conducting a thorough evaluation of LLM observability platforms, with a specific focus on their ability to handle heterogeneous, multi-vendor model deployments. My team’s current stack includes OpenAI, Anthropic’s Claude, and several open-weight models via self-hosted vLLM endpoints. The promise of OpenClaw, as an open-source alternative to commercial offerings like Langfuse or Helicone, is appealing from a cost and control perspective.

However, most documentation and community examples for OpenClaw are heavily skewed towards OpenAI’s API structure. I’m interested in the practical, operational experience of using it with models from other providers. My primary concerns are:

* **Schema Flexibility:** Can OpenClaw’s tracing schema (`Trace`, `Span`, `Generation`) adequately model the unique metadata and response formats from providers like Anthropic or Cohere, or from custom local endpoints?
* **Cost Attribution Granularity:** Does its cost tracking logic extend beyond OpenAI’s per-token pricing? For instance, can it accurately calculate costs for Anthropic (which has different pricing for input/output tokens for different model tiers) or for self-hosted models where cost is based on GPU-hour?
* **Latency Breakdowns:** Are the trace and span timings robust enough to capture network overhead, provider-side latency, and tokenization time for non-OpenAI calls, or is instrumentation fundamentally tied to the OpenAI SDK’s internal hooks?

I performed a preliminary integration test with an Anthropic Claude 3 Opus call. The basic instrumentation worked, but I immediately encountered gaps in the observable data. The `Generation` object seemed to lack fields for Anthropic-specific details like `usage.input_tokens` and `usage.output_tokens` in a standardized way, forcing me to dump them into custom fields.

```python
# Simplified example of the adaptation needed
from openclaw.openclaw_client import OpenClaw
import anthropic

client = OpenClaw(project_name="test")
claude = anthropic.Anthropic()

with client.trace(name="claude_call") as trace:
response = claude.messages.create(
model="claude-3-opus-20240229",
max_tokens=1000,
messages=[{"role": "user", "content": "Hello"}]
)
# Manual extraction and logging of non-standard fields
client.generation(
trace_id=trace.id,
name="claude_completion",
model=response.model,
model_parameters={"max_tokens": 1000},
# OpenClaw expects 'prompt_tokens' and 'completion_tokens'
prompt_tokens=response.usage.input_tokens,
completion_tokens=response.usage.output_tokens,
# Custom metadata for provider-specific data
metadata={"stop_reason": response.stop_reason}
)
```
This manual mapping is brittle and scales poorly across dozens of model types.

Has anyone implemented OpenClaw in a production environment with a truly diverse model portfolio? I am particularly seeking data on:

* The extent of custom code required to normalize traces across providers.
* Whether you extended the OpenClaw schema or database, and the maintenance burden thereof.
* The accuracy of its built-in analytics (latency percentiles, cost dashboards) when fed this heterogeneous data.
* Any comparative benchmarks against more provider-agnostic commercial tools.

A detailed account of your implementation challenges, schema modifications, and the resulting fidelity of your observability would be invaluable for my evaluation.


p-value < 0.05 or bust


   
Quote
(@averyf)
Trusted Member
Joined: 1 week ago
Posts: 53
 

Great question. The schema flexibility was a big issue for me when I tried it with a local Llama endpoint. The `Generation` object expects certain fields, and my endpoint's response format didn't map cleanly.

I had to write a small wrapper function to translate my model's output into OpenClaw's expected structure. It worked, but it felt a bit clunky. I'm not sure how that would scale across all the different vendors you mentioned.

Did you find any examples for Anthropic in their docs? I only saw the OpenAI ones.



   
ReplyQuote
(@benchmark_nerd_1337)
Reputable Member
Joined: 3 months ago
Posts: 183
 

Your concerns about cost attribution granularity are precisely where OpenClaw's abstraction leaks. Its `CostCalculator` class is built around OpenAI's pricing table. While it's modular and you can theoretically subclass it, I've benchmarked the overhead of implementing custom calculators for Anthropic's tiered pricing and for self-hosted vLLM instances where you're tracking GPU-second costs.

The issue isn't feasibility, it's the fidelity of the data model. For self-hosted models, the `Generation` object lacks fields for hardware telemetry (e.g., GPU model, VRAM usage, quantization) needed to derive a meaningful cost. You'd have to shove that into generic metadata tags, which breaks standardized reporting. I had to fork the repository to add a `resource_consumption` JSON field to the schema for a proper comparison of llama-3-70b versus mixtral across different instance types.


numbers don't lie


   
ReplyQuote