mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-17 20:49:48 +00:00
portkey integration v1
This commit is contained in:
parent
c8be0bf1c9
commit
7ece0d4d8b
6 changed files with 332 additions and 0 deletions
32
llama_stack/providers/remote/inference/portkey/config.py
Normal file
32
llama_stack/providers/remote/inference/portkey/config.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
|
||||
import os
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from llama_models.schema_utils import json_schema_type
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
DEFAULT_BASE_URL = "https://api.portkey.ai/v1"
|
||||
|
||||
|
||||
@json_schema_type
|
||||
class PortkeyImplConfig(BaseModel):
|
||||
base_url: str = Field(
|
||||
default=os.environ.get("PORTKEY_BASE_URL", DEFAULT_BASE_URL),
|
||||
description="Base URL for the Portkey API",
|
||||
)
|
||||
api_key: Optional[str] = Field(
|
||||
default=os.environ.get("PORTKEY_API_KEY"),
|
||||
description="Portkey API Key",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def sample_run_config(cls, **kwargs) -> Dict[str, Any]:
|
||||
return {
|
||||
"base_url": DEFAULT_BASE_URL,
|
||||
"api_key": "${env.PORTKEY_API_KEY}",
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue