Skip to main content

Klava is a cli for dead-simple usage cli code agents with any providers. Use claude code with your OpenAI-like provider. Make any code agents more secure - filter out any leaking secret keys and crypto keys from your filesystem.

Project description

klava

High-performance Rust proxy that translates Anthropic API requests to OpenAI-compatible format. Use Claude Code with OpenRouter, native OpenAI, or any OpenAI-compatible endpoint.

Features

  • Fast & Lightweight: Written in Rust with async I/O
  • Universal: Works with any OpenAI-compatible API (OpenRouter, Cloud.ru, local LLMs)

Launch AI Code Agent

The launch command starts the proxy server and launches an AI code agent with appropriate environment variables:

# Interactive selection - shows menu to choose agent
klava launch

# Launch specific agent directly
klava launch claude

# Launch with verbose logging
klava launch claude --verbose

Supported code agents:

Agent Description Link
claude Claude Code https://code.claude.com
opencode OpenCode Agent Coming soon

The launch command automatically:

  • Starts the proxy server in the background
  • Sets necessary environment variables (ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, etc.)
  • Enables demo mode for the agent
  • Shuts down the proxy when the agent exits

If you run klava up, and you want to run claude manually use this command

ANTHROPIC_BASE_URL=http://localhost:8085 claude

Dont' forget to change port to your PORT of klava proxy server.

Known Limitations

The following Anthropic API features are not supported currently (Claude Code and similar tools working without these parameters):): Many of features like images, full list is not ready yet... It's a WIP tool.

Troubleshooting & Known Pitfalls

Error: KLAVA_BASE_URL is required
→ You must set the upstream endpoint URL. Examples:

  • OpenRouter: https://openrouter.ai/api
  • OpenAI: https://api.openai.com
  • Local: http://localhost:11434

Error: 405 Method Not Allowed
→ Your KLAVA_BASE_URL likely ends with /v1. Remove it!

  • ❌ Wrong: https://openrouter.ai/api/v1
  • ✅ Correct: https://openrouter.ai/api
  • The proxy automatically adds /v1/chat/completions

Model not found errors
→ Set REASONING_MODEL and COMPLETION_MODEL to override the models from client requests

Testing

The project includes integration tests using Hurl, a command line tool that can run HTTP requests defined in simple text files.

Installing Hurl

# macOS with Homebrew
brew install hurl

# Linux
curl --proto '=https' --tlsv1.2 -sSf https://hurl.dev/install.sh | sh

# Or from releases
# https://github.com/Orange-OpenSource/hurl/releases

Running Tests

The tests.hurl file contains comprehensive tests for all proxy endpoints:

# Run tests against local development server
hurl --variable host=http://localhost:3000 --test tests.hurl

# Run with mise task (uses localhost:8085)
mise run test-hurl

# Run without host variable (uses default from hurl file if set)
hurl --test tests.hurl

Contributing

Contributions welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

klava-0.1.0.tar.gz (60.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

klava-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

klava-0.1.0-py3-none-macosx_10_12_x86_64.whl (2.9 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file klava-0.1.0.tar.gz.

File metadata

  • Download URL: klava-0.1.0.tar.gz
  • Upload date:
  • Size: 60.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.12

File hashes

Hashes for klava-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a09e8cd99ac8161ccc6d969f34323a854473c67804f1388a9e84c025f1c4e69a
MD5 ad5c48e9d25226c73aa8b111700b04c2
BLAKE2b-256 4a00b005381b6d4243162232cd8a01f1232eedb219694d86661ca37f450385b1

See more details on using hashes here.

File details

Details for the file klava-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for klava-0.1.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2ddc6b934b918a3cdd9d563a53b1fb242fc1190998f2863d996278572fc317dd
MD5 8ab61872cc4225645f3d006b258bbe72
BLAKE2b-256 e3fb48d1af1e10f7c1134df8817bfca863ae71b4870057a2e3465d4b7cae3107

See more details on using hashes here.

File details

Details for the file klava-0.1.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for klava-0.1.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e8c984010c473045929b6751ad669f735e3f18368765010f2b5fe4da4366d48d
MD5 29f219b1900761a58910ff89243141a5
BLAKE2b-256 051c7aff6c323fcbe147f9cc39cb4a8ca4d82a92c6c2976d6d99a81e25c5382b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page