Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rusty-whale

Demo

Open-source, community-driven agent harness — bring your own model. Inspired by CodeWhale (40k+ stars), rewritten from scratch in Rust with a lighter core and stronger verify loop.

Why

CodeWhale is a 40k-star Rust agent harness, but:

  • 30+ provider implementations add bloat — most users only need top 5
  • Verify loop is cargo-only — multi-language projects (Python/JS/Go) get no auto-verify

rusty-whale ships a lighter provider layer (top 5: OpenAI/Anthropic/Gemini/Ollama/vLLM) + a pluggable verify system (cargo/npm/pip/go test).

Architecture

rusty-whale/
  crates/
    rusty-whale-core/      # Agent loop, state machine, tool dispatch
    rusty-whale-provider/  # LlmProvider trait + 5 implementations
    rusty-whale-verify/    # Pluggable verify (cargo/npm/pip/go)
    rusty-whale-tui/       # Terminal UI (ratatui differential rendering)
  examples/
    basic-agent.rs
    custom-verify.rs

Core trait

pub trait LlmProvider: Send + Sync {
    async fn complete(&self, req: &CompletionRequest) -> Result<CompletionResponse>;
    fn name(&self) -> &str;
    fn supports_tools(&self) -> bool;
    fn supports_streaming(&self) -> bool;
}

Agent loop (state machine)

Idle → Thinking (LLM call) → Acting (tool dispatch) → Verifying (auto-cargo/npm) → Done|Waiting

Install

cargo install rusty-whale

Quick start

# Set provider keys
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...

# Run interactive TUI
rusty-whale

# Run non-interactive exec mode
rusty-whale exec "refactor the auth module to use async"

Provider configuration

# ~/.rusty-whale/config.toml
[roles.default]
provider = "anthropic"
model = "claude-sonnet-4-5"
reasoning_tier = "standard"

[roles.codegen]
provider = "openai"
model = "gpt-5-coder"
reasoning_tier = "high"

Each role explicitly records provider, model, and reasoning_tier — so a fleet can span vendors and a role's route never depends on whichever provider happens to be active.

Verify system

Auto-verify after tool execution. Pluggable:

[verify]
command = "cargo build --release"   # or "npm test" / "pytest" / "go test ./..."
fail_action = "retry"               # retry | abort | ask
max_retries = 3

Roadmap

  • Core agent loop + state machine
  • 5 provider implementations
  • Pluggable verify
  • TUI (ratatui)
  • exec mode (non-interactive script mode)
  • i18n (多语言 TUI)
  • MCP client support

License

MIT — see LICENSE.

Acknowledgments

  • CodeWhale — original 40k-star Rust agent harness that inspired this rewrite
  • ratatui — Terminal UI framework

About

Open-source Rust agent harness — bring your own model. Inspired by CodeWhale (40k stars).

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages