tabby/crates/http-api-bindings
Meng Zhang 1ccf9b2323 refactor: run make fix 2023-09-11 12:58:38 +08:00
..
examples feat: add http api bindings (#410) 2023-09-09 03:59:42 +00:00
src refactor: run make fix 2023-09-11 12:58:38 +08:00
Cargo.toml feat: add http api bindings (#410) 2023-09-09 03:59:42 +00:00
README.md feat: add support vertex-ai http bindings (#419) 2023-09-09 11:22:58 +00:00

README.md

Examples

export MODEL_ID="code-gecko"
export PROJECT_ID="$(gcloud config get project)"
export API_ENDPOINT="https://us-central1-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/us-central1/publishers/google/models/${MODEL_ID}:predict"
export AUTHORIZATION="Bearer $(gcloud auth print-access-token)"

cargo run --example simple

Usage

export MODEL_ID="code-gecko"
export PROJECT_ID="$(gcloud config get project)"
export API_ENDPOINT="https://us-central1-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/us-central1/publishers/google/models/${MODEL_ID}:predict"
export AUTHORIZATION="Bearer $(gcloud auth print-access-token)"

cargo run serve --device experimental-http --model "{\"kind\": \"vertex-ai\", \"api_endpoint\": \"$API_ENDPOINT\", \"authorization\": \"$AUTHORIZATION\"}"