tabby/crates/http-api-bindings
leiwen83 b47bdd5d77
fix: align with fastchat mainstream (#670)
Fastchat mainstream change its return format, and text now is only
string in choices structure.

So make this change, to work with mainstream fastchat.

Signed-off-by: Lei Wen <wenlei03@qiyi.com>
Co-authored-by: Lei Wen <wenlei03@qiyi.com>
2023-10-29 19:31:46 -07:00
..
src fix: align with fastchat mainstream (#670) 2023-10-29 19:31:46 -07:00
Cargo.toml Release 0.5.0-dev 2023-10-24 13:05:33 -07: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\"}"