Skip to main content

No project description provided

Project description

Bhumi Logo

Bhumi (भूमि)

🌍 BHUMI - AI Client Setup and Usage Guide

Introduction

Bhumi (भूमि) is the Sanskrit word for Earth, symbolizing stability, grounding, and speed. Just as the Earth moves with unwavering momentum, Bhumi AI ensures that your inference speed is as fast as nature itself! 🚀

Bhumi is an open-source project designed to optimize and accelerate AI inference while maintaining simplicity, flexibility, and multi-model support. Whether you're working with OpenAI, Anthropic, or Gemini, Bhumi makes switching between providers seamless. Our Rust-based implementation is freely available for anyone to use, study, modify, and integrate into their own libraries - we encourage collaboration and improvements from the community!

💡 Note to AI Companies: Feel free to incorporate our performance optimizations into your official libraries! We just ask for appropriate attribution under our Apache 2.0 license.


1️⃣ Installation

To install Bhumi, run the following commands:

rm -rf target/wheels/*
pip uninstall bhumi
maturin develop

Note: Ensure you have Rust and Python installed before proceeding.


2️⃣ Environment Setup

Before running Bhumi, set up your API keys in your terminal:

export OPENAI_API_KEY="your-openai-key"
export GEMINI_API_KEY="your-gemini-key"
export ANTHROPIC_API_KEY="your-anthropic-key"

3️⃣ Python Usage

Here's a basic example to get started with Bhumi:

import os
from bhumi import Bhumi

# Get API keys
OPENAI_KEY = os.environ['OPENAI_API_KEY']
GEMINI_KEY = os.environ['GEMINI_API_KEY']
ANTHROPIC_KEY = os.environ['ANTHROPIC_API_KEY']

# Example prompt
prompt = "Explain what a neural network is in one sentence."

# OpenAI example
openai_client = Bhumi(
    max_concurrent=10,
    provider="openai",
    model="gpt-4o",
    debug=True
)
openai_response = openai_client.completion(
    model="openai/gpt-4o",
    messages=[{"role": "user", "content": prompt}],
    api_key=OPENAI_KEY
)
print("
🌟 OpenAI Response:", openai_response.text)

# Gemini example
gemini_client = Bhumi(
    max_concurrent=10,
    provider="gemini",
    model="gemini-1.5-ultra",
    debug=True
)
gemini_response = gemini_client.completion(
    model="gemini/gemini-1.5-ultra",
    messages=[{"role": "user", "content": prompt}],
    api_key=GEMINI_KEY
)
print("
💡 Gemini Response:", gemini_response.text)

# Anthropic example
anthropic_client = Bhumi(
    max_concurrent=10,
    provider="anthropic",
    model="claude-3-opus",
    debug=True
)
anthropic_response = anthropic_client.completion(
    model="anthropic/claude-3-opus",
    messages=[{"role": "user", "content": prompt}],
    api_key=ANTHROPIC_KEY
)
print("
🤖 Anthropic Response:", anthropic_response.text)

4️⃣ Supported Models

Bhumi supports ALL models from OpenAI, Anthropic, and Gemini, giving you full flexibility!

🔵 OpenAI

  • gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, and more!

🟠 Anthropic

  • claude-3-opus, claude-3-sonnet, claude-3-haiku, and more!

🟢 Gemini

  • gemini-1.5-ultra, gemini-1.5-pro, gemini-1.5-flash, and more!

Current Limitations

  • 🚫 No Tool Use: Bhumi does not currently support function calling or tool use.
  • 🚫 No Streaming: Responses are returned in a single batch; streaming is not yet available.(TODO)

🎯 Why Use Bhumi?

Open Source: Apache 2.0 licensed, free for commercial use
Community Driven: Welcomes contributions from individuals and companies
Blazing Fast: 2-3x faster than alternative solutions
Resource Efficient: Uses 60% less memory than comparable clients
Multi-Model Support: Easily switch between OpenAI, Anthropic, and Gemini
Parallel Requests: Handles multiple concurrent requests effortlessly
Flexibility: Debugging and customization options available
Production Ready: Battle-tested in high-throughput environments


📊 Real-world Performance

In production environments, Bhumi has demonstrated:

  • 125+ requests/second sustained throughput
  • 99.9% uptime with automatic error handling
  • Sub-second latency for most requests
  • Minimal resource footprint even under heavy load

📊 Benchmark Results

Our latest benchmarks show significant performance advantages across different metrics: alt text

⚡ Response Time

  • LiteLLM: 13.79s
  • Native: 5.55s
  • Bhumi: 4.26s
  • Google GenAI: 6.76s

🚀 Throughput (Requests/Second)

  • LiteLLM: 3.48
  • Native: 8.65
  • Bhumi: 11.27
  • Google GenAI: 7.10

💾 Peak Memory Usage (MB)

  • LiteLLM: 275.9MB
  • Native: 279.6MB
  • Bhumi: 284.3MB
  • Google GenAI: 284.8MB

These benchmarks demonstrate Bhumi's superior performance, particularly in throughput where it outperforms other solutions by up to 3.2x. While memory usage remains competitive, the significant gains in response time and throughput make Bhumi an excellent choice for high-performance applications.

🤝 Contributing

We welcome contributions from the community! Whether you're an individual developer or representing a company like Google, OpenAI, or Anthropic, feel free to:

  • Submit pull requests
  • Report issues
  • Suggest improvements
  • Share benchmarks
  • Integrate our optimizations into your libraries (with attribution)

Check out our CONTRIBUTING.md for guidelines.

📜 License

Bhumi is proudly open source under the Apache 2.0 license. This means you can:

  • Use it commercially
  • Modify it
  • Distribute it
  • Use it privately
  • Use it for patents

All we ask is that you provide appropriate attribution and include the license notice.


🌟 Join our community and help make AI inference faster for everyone! 🌟

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

bhumi-0.1.1.tar.gz (5.9 MB view details)

Uploaded Source

Built Distributions

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

bhumi-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bhumi-0.1.1-cp38-abi3-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file bhumi-0.1.1.tar.gz.

File metadata

  • Download URL: bhumi-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for bhumi-0.1.1.tar.gz
Algorithm Hash digest
SHA256 efdf092326bc3e4461b04b0babd26cde1e6e5d76d6da3241434325626fe4753e
MD5 54ec9b2d75af75c4a177585e537d2033
BLAKE2b-256 24ee2f3658b733af6c0afdd3d661a72ca4a9aa127d28e58d8f44cc44f39488bb

See more details on using hashes here.

File details

Details for the file bhumi-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bhumi-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 670103c82c74360357cbb60bca36d0ea38f6926fd68c85aaa3bc3899a4bcd4d3
MD5 2fd0651c3e4dec99972d8ec1f14ff9a9
BLAKE2b-256 a8fcf1e8311915111e568128ba6478dc75f831010bfb3c4317ebeefe53034edd

See more details on using hashes here.

File details

Details for the file bhumi-0.1.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bhumi-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f70745387995de1aa6922a704bdb1168f12ec605b3659a0e8ef20599dbfd3abd
MD5 8a425d07f070b7bb3a154e0a6781f230
BLAKE2b-256 5f444f37dd5c8449cf865e62739767d8ce554485b700f1543429314bbf4e1123

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