mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-29 15:23:51 +00:00
fix memory router naming
This commit is contained in:
parent
28065ca53a
commit
e0ad4fb99c
3 changed files with 52 additions and 41 deletions
|
@ -81,16 +81,18 @@ def configure_api_providers(
|
||||||
except Exception:
|
except Exception:
|
||||||
existing = None
|
existing = None
|
||||||
cfg = prompt_for_config(config_type, existing)
|
cfg = prompt_for_config(config_type, existing)
|
||||||
config.api_providers[api_str] = GenericProviderConfig(
|
|
||||||
provider_id=p,
|
|
||||||
config=cfg.dict(),
|
|
||||||
)
|
|
||||||
|
|
||||||
if api_str in router_api2builtin_api:
|
if api_str in router_api2builtin_api:
|
||||||
# a routing api, we need to assign it a routing_key and put it in the routing_table
|
# a routing api, we need to infer and assign it a routing_key and put it in the routing_table
|
||||||
routing_key = prompt(
|
routing_key = prompt(
|
||||||
"> Enter routing key for the {} provider: ".format(api_str),
|
"> Enter routing key for the {} provider: ".format(api_str),
|
||||||
)
|
)
|
||||||
|
config.routing_table[]
|
||||||
|
else:
|
||||||
|
config.api_providers[api_str] = GenericProviderConfig(
|
||||||
|
provider_id=p,
|
||||||
|
config=cfg.dict(),
|
||||||
|
)
|
||||||
|
|
||||||
print("")
|
print("")
|
||||||
|
|
||||||
|
|
|
@ -46,9 +46,9 @@ class MemoryRouter(Memory):
|
||||||
url: Optional[URL] = None,
|
url: Optional[URL] = None,
|
||||||
) -> MemoryBank:
|
) -> MemoryBank:
|
||||||
bank_type = config.type
|
bank_type = config.type
|
||||||
provider = await self.routing_table.get_provider_impl(
|
bank = await self.routing_table.get_provider_impl(bank_type).create_memory_bank(
|
||||||
bank_type
|
name, config, url
|
||||||
).create_memory_bank(name, config, url)
|
)
|
||||||
self.bank_id_to_type[bank.bank_id] = bank_type
|
self.bank_id_to_type[bank.bank_id] = bank_type
|
||||||
return bank
|
return bank
|
||||||
|
|
||||||
|
|
|
@ -13,38 +13,47 @@ api_providers:
|
||||||
telemetry:
|
telemetry:
|
||||||
provider_id: meta-reference
|
provider_id: meta-reference
|
||||||
config: {}
|
config: {}
|
||||||
safety:
|
|
||||||
provider_id: meta-reference
|
|
||||||
config:
|
|
||||||
llama_guard_shield:
|
|
||||||
model: Llama-Guard-3-8B
|
|
||||||
excluded_categories: []
|
|
||||||
disable_input_check: false
|
|
||||||
disable_output_check: false
|
|
||||||
prompt_guard_shield:
|
|
||||||
model: Prompt-Guard-86M
|
|
||||||
agents:
|
agents:
|
||||||
provider_id: meta-reference
|
provider_id: meta-reference
|
||||||
config: {}
|
config:
|
||||||
provider_routing_table:
|
persistence_store:
|
||||||
inference:
|
namespace: null
|
||||||
- routing_key: Meta-Llama3.1-8B-Instruct
|
type: sqlite
|
||||||
provider_id: meta-reference
|
db_path: /home/xiyan/.llama/runtime/kvstore.db
|
||||||
config:
|
routing_tables:
|
||||||
model: Meta-Llama3.1-8B-Instruct
|
models:
|
||||||
quantization: null
|
entries:
|
||||||
torch_seed: null
|
- routing_key: Meta-Llama3.1-8B-Instruct
|
||||||
max_seq_len: 4096
|
provider_id: meta-reference
|
||||||
max_batch_size: 1
|
config:
|
||||||
- routing_key: Meta-Llama3.1-8B
|
model: Meta-Llama3.1-8B-Instruct
|
||||||
provider_id: meta-reference
|
quantization: null
|
||||||
config:
|
torch_seed: null
|
||||||
model: Meta-Llama3.1-8B
|
max_seq_len: 4096
|
||||||
quantization: null
|
max_batch_size: 1
|
||||||
torch_seed: null
|
- routing_key: Meta-Llama3.1-8B
|
||||||
max_seq_len: 4096
|
provider_id: meta-reference
|
||||||
max_batch_size: 1
|
config:
|
||||||
memory:
|
model: Meta-Llama3.1-8B
|
||||||
- routing_key: vector
|
quantization: null
|
||||||
provider_id: meta-reference
|
torch_seed: null
|
||||||
config: {}
|
max_seq_len: 4096
|
||||||
|
max_batch_size: 1
|
||||||
|
memory_banks:
|
||||||
|
entries:
|
||||||
|
- routing_key: vector
|
||||||
|
provider_id: meta-reference
|
||||||
|
config: {}
|
||||||
|
shields:
|
||||||
|
entries:
|
||||||
|
- routing_key: llama_guard_shield
|
||||||
|
provider_id: meta-reference
|
||||||
|
config:
|
||||||
|
model: Llama-Guard-3-8B
|
||||||
|
excluded_categories: []
|
||||||
|
disable_input_check: false
|
||||||
|
disable_output_check: false
|
||||||
|
- routing_key: prompt_guard_shield
|
||||||
|
provider_id: meta-reference
|
||||||
|
config:
|
||||||
|
model: Prompt-Guard-86M
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue