Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Contributing to BESH

We welcome contributions from the community! By contributing to this project, you agree to the following terms.

## Contributor License Agreement (CLA)

By submitting code contributions (pull requests, patches, or any other form of code submission) to this project, you agree that:

1. **Copyright Assignment**: You assign all copyright and related rights in your contributions to **MIH AI B.V.**

2. **Licensing**: Your contributions will be licensed under the same license as this project (Apache License 2.0).

3. **Originality**: You represent that your contributions are your original work and that you have the right to assign the copyright to MIH AI B.V.

4. **No Conflicting Obligations**: You are not subject to any agreement or obligation that would prevent you from making these contributions.

## How to Contribute

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## Code Review Process

All submissions require review before being merged. We will:
- Review code quality and consistency
- Run automated tests
- Verify compliance with project standards

## Questions?

If you have questions about the contribution process or CLA, please contact the project maintainers or Prosus Legal.

---

**By submitting a contribution, you acknowledge that you have read and agree to the terms above.**
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

END OF TERMS AND CONDITIONS

Copyright 2025 Floris Fok
Copyright © 2025 MIH AI B.V.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
52 changes: 52 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
BESH
Copyright © 2025 MIH AI B.V.

This product is licensed under the Apache License, Version 2.0.

This software includes third-party open source software components.
The following is a list of these components with their respective licenses.

================================================================================
THIRD-PARTY DEPENDENCIES
================================================================================

Weak-copyleft components (LGPL / MPL) — use reviewed and approved by Prosus Legal:
--------------------------------------------------------------------------------
Component: psycopg (psycopg3) License: LGPL-3.0 Source: https://github.com/psycopg/psycopg
Component: certifi License: MPL-2.0 Source: https://github.com/certifi/python-certifi
Component: tqdm License: MPL-2.0 / MIT Source: https://github.com/tqdm/tqdm

Permissive components (Apache-2.0 / MIT / BSD / ISC):
--------------------------------------------------------------------------------
Component: FastAPI License: MIT Source: https://github.com/fastapi/fastapi
Component: Uvicorn License: BSD-3-Clause Source: https://github.com/encode/uvicorn
Component: Starlette License: BSD-3-Clause Source: https://github.com/encode/starlette
Component: Pydantic License: MIT Source: https://github.com/pydantic/pydantic
Component: SQLAlchemy License: MIT Source: https://github.com/sqlalchemy/sqlalchemy
Component: asyncpg License: Apache-2.0 Source: https://github.com/MagicStack/asyncpg
Component: redis-py License: MIT Source: https://github.com/redis/redis-py
Component: LiteLLM License: MIT Source: https://github.com/BerriAI/litellm
Component: OpenAI Python License: Apache-2.0 Source: https://github.com/openai/openai-python
Component: huggingface-hub License: Apache-2.0 Source: https://github.com/huggingface/huggingface_hub
Component: tokenizers License: Apache-2.0 Source: https://github.com/huggingface/tokenizers
Component: tiktoken License: MIT Source: https://github.com/openai/tiktoken
Component: requests License: Apache-2.0 Source: https://github.com/psf/requests
Component: urllib3 License: MIT Source: https://github.com/urllib3/urllib3
Component: aiohttp License: Apache-2.0 Source: https://github.com/aio-libs/aiohttp
Component: httpx License: BSD-3-Clause Source: https://github.com/encode/httpx
Component: Jinja2 License: BSD-3-Clause Source: https://github.com/pallets/jinja
Component: MarkupSafe License: BSD-3-Clause Source: https://github.com/pallets/markupsafe
Component: Werkzeug License: BSD-3-Clause Source: https://github.com/pallets/werkzeug
Component: click License: BSD-3-Clause Source: https://github.com/pallets/click
Component: itsdangerous License: BSD-3-Clause Source: https://github.com/pallets/itsdangerous
Component: blinker License: MIT Source: https://github.com/pallets-eco/blinker
Component: PyYAML License: MIT Source: https://github.com/yaml/pyyaml
Component: orjson License: Apache-2.0 / MIT Source: https://github.com/ijl/orjson
Component: python-multipart License: Apache-2.0 Source: https://github.com/Kludex/python-multipart
Component: python-dotenv License: BSD-3-Clause Source: https://github.com/theskumar/python-dotenv
Component: anyio License: MIT Source: https://github.com/agronholm/anyio
Component: certifi's peers (idna, sniffio, h11, httpcore, etc.) License: MIT / BSD

For complete license texts, see the LICENSE files in the respective dependencies
or visit the source repositories. This list covers the primary declared
dependencies; transitive dependencies inherit compatible permissive licenses.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

![BESH Logo Banner](images/BESH_LOGO_BANNER.png)

[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)


A high-performance batch processing API for large language models with support for both single-GPU and multi-GPU (8-GPU) deployments.

Expand Down Expand Up @@ -218,8 +220,21 @@ docker compose -f <compose-file> up -d --no-deps --build batch-api
Contributions are welcome! Feel free to open an issue or submit a pull request.


## Contact

- **Author:** Floris Fok
- **📧 Email:** [floris.fok@prosus.com](mailto:floris.fok@prosus.com)
- **🔗 LinkedIn:** [floris-jan-fok](https://www.linkedin.com/in/floris-jan-fok/)
---

## License

Copyright © 2025 MIH AI B.V.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
4 changes: 4 additions & 0 deletions configs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

from .config import Config, get_config

__all__ = ['Config', 'get_config']
4 changes: 4 additions & 0 deletions configs/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

import os
from pathlib import Path
from dotenv import load_dotenv
Expand Down
4 changes: 4 additions & 0 deletions scripts/check_batch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

import requests
import sys
import json
Expand Down
4 changes: 4 additions & 0 deletions scripts/delete_x.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

import requests
from concurrent.futures import ThreadPoolExecutor, as_completed
import argparse
Expand Down
4 changes: 4 additions & 0 deletions src/auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

"""Authentication middleware for protecting endpoints."""

import os
Expand Down
4 changes: 4 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

import os
import asyncio
from contextlib import asynccontextmanager
Expand Down
4 changes: 4 additions & 0 deletions src/models/batch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

import asyncpg
import os
import urllib.parse
Expand Down
4 changes: 4 additions & 0 deletions src/routes/batch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

import os
import json
import uuid
Expand Down
4 changes: 4 additions & 0 deletions src/routes/files.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

import os
import uuid
import json
Expand Down
4 changes: 4 additions & 0 deletions testing/test_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python3
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

"""
Test script for OpenAI Batch API
"""
Expand Down
4 changes: 4 additions & 0 deletions testing/test_large.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env python3
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

"""
Demo script testing compressed file uploads for batch processing

Expand Down
4 changes: 4 additions & 0 deletions worker/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Copyright © 2025 MIH AI B.V.
# Licensed under the Apache License, Version 2.0.
# See LICENSE file in the project root for full license information.

import asyncio
import aiofiles
import json
Expand Down