MCPcopy Index your code
hub / github.com/UKP-SQuARE/square-core

github.com/UKP-SQuARE/square-core @v3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.0 ↗ · + Follow
1,394 symbols 5,088 edges 254 files 441 documented · 32%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Local Deployment of Minimal SQuARE

This branch hosts a minimal version of SQuARE for the convenience of local deployment.

To get started, please run:

pip install -r local_deploy/requirements.txt
bash install-local.sh

to generate a docker-compose.yaml file (and a authentication token for local deployment in ./local_deploy)

And then:

docker-compose up -d
python local_deploy/embed_query.py  # An example of calling model API to embed a query
python local_deploy/deploy_ds.py  # An example of deploying a new datastore

This will start the minimal SQUARE service and run the example script local_deploy/deploy_ds.py to - Download example corpus scifact; - Upload the corpus (to the ES in SQUARE); - Do BM25 search; - Embed and index the corpus with DPR (GPU 1min, CPU 30min); - Start a Faiss container to load the built dense index; - Do dense search.

One can also get access to the SWAGGER UI page for the interactive API of Datastores. To do so, one can do

export SQUARE_PRIVATE_KEY_FILE="local_deploy/private_key.pem"
square_token  # A Python entry point from `square_auth`

to get the token for authorization. Thereafter, just open http://localhost:7000/docs# and type in the token by clicking on "Authorize". Then you are ready to go.

Core symbols most depended-on inside this repo

get
called by 234
evaluator/evaluator/app/core/evaluation_handler.py
format
called by 84
evaluator/evaluator/app/core/dataset_formatter.py
predict
called by 53
model-inference/model_inference/tasks/inference/model.py
to
called by 32
model-inference/offline_encoding_for_data_api.py
load
called by 27
model-inference/model_inference/tasks/config/model_config.py
encode
called by 19
model-inference/model_inference/tasks/inference/transformer.py
_datastore_docs_index_name
called by 19
datastore-api/app/core/es/connector.py
set_test_config
called by 16
model-inference/model_inference/tasks/config/model_config.py

Shape

Method 590
Function 464
Class 205
Route 135

Languages

Python96%
TypeScript4%

Modules by API surface

model-inference/model_inference/tasks/inference/utils/modelling/layers.py61 symbols
datastore-api/app/routers/kgs.py34 symbols
model-inference/tests/onnx/test_inference/test_onnx.py29 symbols
model-manager/model_manager/app/routers/management.py28 symbols
model-inference/tests/transformer/test_inference/test_transformers.py28 symbols
model-inference/model_inference/tasks/inference/transformer.py27 symbols
datastore-api/app/core/es/connector.py27 symbols
model-inference/model_inference/tasks/inference/graph_transformers.py25 symbols
datastore-api/tests/conftest.py25 symbols
model-inference/tests/transformer/test_inference/test_adapter.py24 symbols
datastore-api/app/core/base_connector.py24 symbols
skill-manager/tests/test_api.py22 symbols

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add square-core \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page