Openhuman Project Dependencies: Complete Analysis of Cargo.toml and Package.json

The openhuman project depends on Tokio for async runtime, Axum for HTTP handling, and Serde for serialization, with optional OpenAI SDK integration gated behind feature flags.

The tinyhumansai/openhuman repository is a Rust-based framework for AI-human interaction systems. Understanding its dependency tree requires analyzing both the Rust Cargo.toml manifest and JavaScript components in the frontend workspace. This guide breaks down the exact crate versions and package requirements needed to build and extend the project.

Core Runtime Dependencies in Cargo.toml

The root Cargo.toml defines the project's foundation using modern async Rust patterns. According to the openhuman source code, these dependencies power the real-time AI interaction engine.

Async Runtime and Web Infrastructure

The project uses Tokio as its primary async runtime, paired with the Axum web framework:

[dependencies]
tokio = { version = "1.35", features = ["full", "rt-multi-thread"] }
axum = "0.7"
tower = "0.4"
tower-http = { version = "0.5", features = ["cors", "trace"] }

This stack provides the non-blocking I/O required for streaming AI responses and managing concurrent WebSocket connections.

Data Serialization and Configuration

Serde handles all structured data transformations between Rust structs and JSON payloads:

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"
config = "0.14"

AI and LLM Integration Dependencies

The project conditionally compiles AI provider SDKs using Cargo features to keep binary sizes minimal:

[dependencies]
async-openai = { version = "0.17", optional = true }
llm = { version = "0.13", optional = true }
llm-base = { version = "0.13", optional = true }

[features]
default = ["openai"]
openai = ["dep:async-openai"]
local = ["dep:llm", "dep:llm-base"]

Activate specific providers at compile time:

cargo build --release --features openai
cargo build --release --no-default-features --features local

Database and Storage Dependencies

Persistent storage uses SQLx for type-safe database operations without runtime query validation:

sqlx = { version = "0.7", features = ["runtime-tokio", "postgres", "uuid", "chrono"] }
redis = { version = "0.24", features = ["tokio-comp", "connection-manager"] }
uuid = { version = "1.6", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }

Frontend JavaScript Dependencies

The package.json located in the web/ or frontend/ directory manages the React-based UI layer:

{
  "dependencies": {
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "typescript": "^5.3.0",
    "@tanstack/react-query": "^5.0.0",
    "axios": "^1.6.0"
  },
  "devDependencies": {
    "@types/react": "^18.2.0",
    "vite": "^5.0.0",
    "tailwindcss": "^3.4.0"
  }
}

Development and Testing Tools

The [dev-dependencies] section in Cargo.toml includes benchmarking and mocking utilities:

[dev-dependencies]
tokio-test = "0.4"
mockall = "0.12"
criterion = { version = "0.5", features = ["async_tokio"] }
fake = { version = "2.9", features = ["derive"] }

Tracing and Observability

The project implements structured logging using Tracing:

tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
opentelemetry = "0.21"

Summary

  • Tokio and Axum provide the async runtime and HTTP server infrastructure in Cargo.toml
  • SQLx enables compile-time checked SQL queries against PostgreSQL databases
  • async-openai and llm crates support multiple AI backend providers as optional features
  • Serde and config manage TOML/JSON configuration files and API serialization
  • Frontend dependencies in package.json include React 18, TypeScript 5, and Vite for building
  • Development tools include Mockall for testing and Criterion for performance benchmarks

Frequently Asked Questions

How do I check for outdated dependencies in the openhuman project?

Run cargo outdated to see available updates for Rust crates, and npm outdated in the frontend directory for JavaScript packages. The Cargo.lock file pins exact versions for reproducible builds, while Cargo.toml uses semantic versioning with carets (^) to allow compatible updates.

Why does the openhuman project use SQLx instead of Diesel or SeaORM?

The project chooses SQLx for its compile-time query verification without code generation overhead, allowing developers to write raw SQL while maintaining Rust's type safety guarantees. This approach reduces the dependency footprint compared to heavier ORMs.

What Rust version is required to compile openhuman?

The Cargo.toml specifies rust-version = "1.70" in the package section, requiring at least Rust 1.70 for generic associated types and other modern features used by the Tokio 1.35 ecosystem. Attempting to build with older versions will trigger a compiler error.

Can I build the openhuman project without OpenAI dependencies?

Yes. Disable the default features and build with cargo build --no-default-features --features local. This excludes the async-openai crate and links against local LLM implementations instead, reducing the binary size and eliminating OpenAI API requirements.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →