Package: arcee-py
DALM by ArceeThe Arcee client for executing domain-adpated language model routinesInstallationpip install arcee-pyAuthenticatingYour Arcee API key is obtained at app.arcee.aiIn bash:export ARCEE_API_KEY=********In notebook:import os
os.environ["ARCEE_API_KEY"] = "********"Upload ContextUpload context for your domain adapted langauge model to draw from.import arcee
arcee.upload_doc("pubmed", doc_name="doc1", doc_text="whoa")
# or
# arcee.upload_docs("pubmed", docs=[{"doc_name": "doc1", "doc_text": "foo"}, {"doc_name": "doc2", "doc_text": "bar"}])Train DALMTrain a DALM with the context you have uploaded.import arcee
dalm = arcee.train_dalm("medical_dalm", context="pubmed")
# Wait for training to complete
arcee.get_dalm_status("medical_dalm")The DALM training procedure trains your model in context and stands up an index for your model to draw from.DALM Generationimport arcee
med_dalm = arcee.get_dalm("medical_dalm")
med_dalm.generate("What are the components of Scoplamine?")DALM RetrievalRetrieve documents for a given query and to view them or plug into a different LLM.import arcee
med_dalm = arcee.get_dalm("medical_dalm")
med_dalm.retrieve("my query")Using the Arcee CLIYou can easily train and use your Domain-Adapted Language Model (DALM) with Arcee using the CLI. Follow these steps post installation to train and utilize your DALM:Upload ContextUpload a context file for your DALM like,arceeuploadcontextpubmed--filedoc1Upload all files in a directory like,arceeuploadcontextpubmed--directorydocsUpload any combination of files and directories with,arceeuploadcontextpubmed--directorysome_docs--filedoc1--directorymore_docs--filedoc2Note: The upload command ensures only valid and unique files are uploaded.Train your DALM:Train your DALM with any uploaded context like,arceetrainmedical_dalm--contextpubmed# wait for training to complete...DALM Generation:Generate text completions from a model like,arceegeneratemedical_dalm--query"Can AI-driven music therapy contribute to the rehabilitation of patients with disorders of consciousness?"DALM Retrieval:Retrieve documents for a given query and to view them or plug into a different LLM like,arceeretrievemedical_dalm--query"Can AI-driven music therapy contribute to the rehabilitation of patients with disorders of consciousness?"ContributingWe useinvoketo manage this repo. You don't need to use it, but it simplifies the workflow.Set up the repogitclonehttps://github.com/arcee-ai/arcee-python&&cdarcee-python# optionally setup your virtual environment (recommended)python-mvenv.venv&&source.venv/bin/activate# install repopipinstallinvoke
invinstallFormat, lint, testinvformat# run black and ruffinvlint# black check, ruff check, mypyinvtest# pytestPublishingWe publish in this repo by creating a new release/tag in github. On release, a github action will
publish the__version__of arcee-py that is inarcee/__init__.pySo you need to increase that version before releasing, otherwise it will failTo create a new releaseOpen a PR increasing the__version__of arcee-py. You can manually edit it or runinv uvCreate a new release, with the name being the__version__of arcee-pyManual release [not recommended]We do not recommend this. If you need to, please make the version number an alpha or beta release.If you need to create a manual release, you can runinv build && inv publish