-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
211 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[tool.commitizen] | ||
name = "cz_conventional_commits" | ||
tag_format = "v$version" | ||
major_version_zero = true | ||
update_changelog_on_bump = true | ||
version = "0.0.0" | ||
version_files = ["Cargo.toml"] | ||
version_provider = "cargo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Rust | ||
name: Build and test | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Publish Docker Images | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
publish: | ||
name: Publish Docker Images | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Log in to the GitHub Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract metadata for Docker | ||
id: docker-metadata | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
ghcr.io/traceloop/hub # GitHub | ||
traceloop/hub # Docker Hub | ||
tags: | | ||
type=sha | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.docker-metadata.outputs.tags }} | ||
labels: ${{ steps.docker-metadata.outputs.labels }} | ||
platforms: | | ||
linux/amd64, linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Release a New Version | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: Bump Versions | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
|
||
- id: cz | ||
name: Bump Version, Create Tag and Changelog | ||
uses: commitizen-tools/commitizen-action@master | ||
with: | ||
github_token: ${{ secrets.GH_ACCESS_TOKEN }} | ||
changelog_increment_filename: body.md | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
body_path: "body.md" | ||
tag_name: ${{ env.REVISION }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | ||
|
||
- name: Print Version | ||
run: echo "Bumped to version ${{ steps.cz.outputs.version }}" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,16 @@ | ||
ARG RUST_VERSION=1.82.0 | ||
ARG APP_NAME=gateway | ||
FROM rust:${RUST_VERSION}-slim-bookworm AS build | ||
ARG APP_NAME | ||
WORKDIR /app | ||
|
||
RUN --mount=type=bind,source=src,target=src \ | ||
--mount=type=bind,source=Cargo.toml,target=Cargo.toml \ | ||
--mount=type=bind,source=Cargo.lock,target=Cargo.lock \ | ||
--mount=type=cache,target=/app/target/ \ | ||
--mount=type=cache,target=/usr/local/cargo/registry/ \ | ||
<<EOF | ||
set -e | ||
cargo build --locked --release | ||
cp ./target/release/$APP_NAME /bin/server | ||
EOF | ||
|
||
FROM debian:bookworm-slim AS final | ||
FROM rust:1.82-bookworm AS builder | ||
|
||
ARG UID=10001 | ||
RUN adduser \ | ||
--disabled-password \ | ||
--gecos "" \ | ||
--home "/nonexistent" \ | ||
--shell "/sbin/nologin" \ | ||
--no-create-home \ | ||
--uid "${UID}" \ | ||
appuser | ||
USER appuser | ||
WORKDIR /app | ||
COPY . . | ||
RUN cargo build --release --bin hub | ||
|
||
COPY --from=build /bin/server /bin/ | ||
FROM debian:bookworm-slim AS runtime | ||
RUN apt-get update && apt-get install -y openssl ca-certificates | ||
WORKDIR /app | ||
COPY --from=builder /app/target/release/hub /usr/local/bin | ||
WORKDIR /etc | ||
|
||
ENV PORT 3000 | ||
EXPOSE 3000 | ||
|
||
CMD ["/bin/server"] | ||
ENTRYPOINT ["/usr/local/bin/hub", "/etc/config.yaml"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,69 @@ | ||
# gateway | ||
<h1 align="center"> | ||
Traceloop Hub | ||
</h1> | ||
<p align="center"> | ||
<p align="center">Open-source, high-performance LLM gateway written in Rust. Connect to any LLM provider with a single API. Observability Included.</p> | ||
</p> | ||
<h4 align="center"> | ||
<a href="https://traceloop.com/docs/hub/getting-started"><strong>Get started »</strong></a> | ||
<br /> | ||
<br /> | ||
<a href="https://traceloop.com/slack">Slack</a> | | ||
<a href="https://traceloop.com/docs/hub">Docs</a> | ||
</h4> | ||
|
||
<h4 align="center"> | ||
<a href="https://github.com/traceloop/hub/releases"> | ||
<img src="https://img.shields.io/github/release/traceloop/hub"> | ||
</a> | ||
<a href="https://github.com/traceloop/hub/blob/main/LICENSE"> | ||
<img src="https://img.shields.io/badge/license-Apache 2.0-blue.svg" alt="Traceloop Hub is released under the Apache-2.0 License"> | ||
</a> | ||
<a href="https://github.com/traceloop/hub/actions/workflows/ci.yml"> | ||
<img src="https://github.com/traceloop/hub/actions/workflows/ci.yml/badge.svg"> | ||
</a> | ||
<a href="https://github.com/traceloop/hub/issues"> | ||
<img src="https://img.shields.io/github/commit-activity/m/traceloop/hub" alt="git commit activity" /> | ||
</a> | ||
<a href="https://www.ycombinator.com/companies/traceloop"><img src="https://img.shields.io/website?color=%23f26522&down_message=Y%20Combinator&label=Backed&logo=ycombinator&style=flat-square&up_message=Y%20Combinator&url=https%3A%2F%2Fwww.ycombinator.com"></a> | ||
<a href="https://github.com/traceloop/hub/blob/main/CONTRIBUTING.md"> | ||
<img src="https://img.shields.io/badge/PRs-Welcome-brightgreen" alt="PRs welcome!" /> | ||
</a> | ||
<a href="https://traceloop.com/slack"> | ||
<img src="https://img.shields.io/badge/chat-on%20Slack-blueviolet" alt="Slack community channel" /> | ||
</a> | ||
<a href="https://twitter.com/traceloopdev"> | ||
<img src="https://img.shields.io/badge/follow-%40traceloopdev-1DA1F2?logo=twitter&style=social" alt="Traceloop Twitter" /> | ||
</a> | ||
</h4> | ||
|
||
Hub is a next generation smart proxy for LLM applications. It centralizes control and tracing of all LLM calls and traces. | ||
It's built in Rust so it's fast and efficient. It's completely open-source and free to use. | ||
|
||
Built and maintained by Traceloop under the Apache 2.0 license. | ||
|
||
## 🚀 Getting Started | ||
|
||
Make sure to copy a `config.yaml` file from `config-example.yaml` and set the correct values, following the [configuration](https://www.traceloop.com/docs/hub/configuration) instructions. | ||
|
||
You can then run the hub locally by running `cargo run` in the root directory, or using the docker image: | ||
|
||
``` | ||
docker run --rm -p 3000:3000 -v $(pwd)/config.yaml:/etc/config.yaml:ro -t traceloop/hub | ||
``` | ||
|
||
## 🌱 Contributing | ||
|
||
Whether big or small, we love contributions ❤️ Check out our guide to see how to [get started](https://traceloop.com/docs/hub/contributing/overview). | ||
|
||
Not sure where to get started? You can: | ||
|
||
- [Book a free pairing session with one of our teammates](mailto:[email protected]?subject=Pairing%20session&body=I'd%20like%20to%20do%20a%20pairing%20session!)! | ||
- Join our <a href="https://traceloop.com/slack">Slack</a>, and ask us any questions there. | ||
|
||
## 💚 Community & Support | ||
|
||
- [Slack](https://traceloop.com/slack) (For live discussion with the community and the Traceloop team) | ||
- [GitHub Discussions](https://github.com/traceloop/hub/discussions) (For help with building and deeper conversations about features) | ||
- [GitHub Issues](https://github.com/traceloop/hub/issues) (For any bugs and errors you encounter using OpenLLMetry) | ||
- [Twitter](https://twitter.com/traceloopdev) (Get news fast) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters