Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3rd party endpoint token local storage #29

Open
pandu-k opened this issue Nov 2, 2022 · 1 comment
Open

3rd party endpoint token local storage #29

pandu-k opened this issue Nov 2, 2022 · 1 comment

Comments

@pandu-k
Copy link
Collaborator

pandu-k commented Nov 2, 2022

In order to support private 3rd party models, users will need to pass API tokens alongside requests to Marqo. Users will pass the model’s name and API token (from cURL or py-marqo) which will be used for inferences. The py-marqo client will have the ability to save the model credentials somewhere locally as key-value pairs (which are overwritten by env vars).

In order to provide a user-friendly experience, py-marqo needs a feature to optionally store API keys and retrieve the appropriate ones for requests.

The usage could be something like this:

marqo.add_model_creds(('my-custom-model', 'my-secret-token'))

or this:

marqo.add_model_creds(token=('my-custom-model', 'my-secret-token'), applicable_indexes=["my-ix", "cool-ix-2"])

Which stores it in ~/.marqo/credentials

@pandu-k pandu-k changed the title 3rd party endpoint key local storage 3rd party endpoint token local storage Nov 2, 2022
@pandu-k
Copy link
Collaborator Author

pandu-k commented Nov 2, 2022

On indexes and searches the pattern could be this:

mq.index("my-ix").add_documents(
    [{"Title": "Where the wild things are"}], 
    models_tokens=["my-custom-model"]
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant