Skip to main content

Local Copilot as a Service wrapper with CLI and REST APIs.

Project description

copilot-service

copilot-as-a-service

copilot-service provides a stable local CLI and REST wrapper around Copilot/LLM CLI tooling so scripts and agents can call a normalized task API.

What problem this solves

Different LLM CLIs have different prompt formats and output styles. This project gives one stable contract for task-based calls (route-topic, freeform) and isolates provider setup in local config.

Releases

Automated releases are available through GitHub Actions. See docs/release.md for full instructions.

Python client

from copilot_service.client import CopilotServiceClient

client = CopilotServiceClient()  # connects to http://127.0.0.1:8765

result = client.freeform("Explain this error")
if result.ok:
    print(result.content["text"])

result = client.route_topic(
    title="Article title",
    message="Full message",
    article_excerpt="...",
    topics={"asr": "Speech Recognition", "nlp": "NLP"},
)
print(result.content["decision"])

See docs/api-contract.md for the full API contract.

CLI UX

Running copilot-caas with no arguments shows a colorful welcome screen and exits 0:

copilot-caas

Check the installed version:

copilot-caas --version

Run a task:

copilot-caas ask --input examples/route-topic-request.json

Colors are automatically disabled when NO_COLOR is set or output is not a TTY.

Quickstart (fake provider)

python -m venv .venv
. .venv/bin/activate
pip install -e .

export COPILOT_SERVICE_PROVIDER=fake
export COPILOT_SERVICE_FAKE_RESPONSE='{"decision":"asr","confidence":0.8,"reason":"fake"}'
copilot-service ask --input examples/route-topic-request.json

Quickstart (shell provider)

export COPILOT_SERVICE_PROVIDER=shell
export COPILOT_SERVICE_SHELL_COMMAND='python -c "import sys; print(sys.stdin.read())"'
copilot-service ask --task freeform --prompt "Explain this"

REST usage

copilot-service serve --host 127.0.0.1 --port 8765

curl -sS http://127.0.0.1:8765/health
curl -sS http://127.0.0.1:8765/v1/ask \
  -H 'content-type: application/json' \
  --data @examples/freeform-request.json
curl -sS http://127.0.0.1:8765/v1/tasks/route-topic \
  -H 'content-type: application/json' \
  --data @examples/route-topic-request.json

Article-ingestion integration example

See examples/article-ingestion-usage.sh for a simple pipeline wrapper around the route-topic task.

Environment

  • COPILOT_SERVICE_PROVIDER (shell for MVP, fake for tests)
  • COPILOT_SERVICE_SHELL_COMMAND (provider command)
  • COPILOT_SERVICE_MODEL (default gpt-5-mini)
  • COPILOT_SERVICE_TIMEOUT_SECONDS (default 90)
  • COPILOT_SERVICE_HOST (default 127.0.0.1)
  • COPILOT_SERVICE_PORT (default 8765)

Limitations

  • MVP ships only with shell/fake providers.
  • Output quality depends on your configured local command and prompt discipline.
  • route-topic fallback behavior can mask model errors when enabled (default true).

Security note

REST binds to 127.0.0.1 by default. The shell command is loaded only from local environment/config (never from request payload).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

copilot_caas-0.3.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

copilot_caas-0.3.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file copilot_caas-0.3.0.tar.gz.

File metadata

  • Download URL: copilot_caas-0.3.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for copilot_caas-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fbce64badbb167910f20667117621ec4164309c69d18473b2da19357828d95b1
MD5 0845f036d4ca324f1eeda4f1180756e2
BLAKE2b-256 e8f550a857b77766cf46d6e79f402c452b54fff0d941273b3a962b600e0b1f1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for copilot_caas-0.3.0.tar.gz:

Publisher: publish.yml on tiroq/copilot-service

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file copilot_caas-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: copilot_caas-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for copilot_caas-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd8e9d10a2d9d9b218572301d26ec83d16cb80c0c7c9997a829d559469d40442
MD5 992a083f0aeedd191911c5873f7c9318
BLAKE2b-256 a6de18660840a801afac68a81e837b8ea0ae48d95de8ae4db10520a7b64c60fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for copilot_caas-0.3.0-py3-none-any.whl:

Publisher: publish.yml on tiroq/copilot-service

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page