Skip to content

Commit 53440d9

Browse files
fatdinheroona-agent
andcommitted
deploy: agentsprotocol-detect API on Fly.io
- Dockerfile: bundle deps as local wheels (Depot builder has no PyPI access) - fly.toml: fra region, 256MB shared-cpu-1x - api.py: fix compute_s_con() kwarg (corpus -> knowledge_corpus) - requirements.txt: remove local file:// reference - .gitignore: exclude detect/wheels/ and detect/agentsprotocol_pkg/ Live at https://agentsprotocol-detect.fly.dev/ Co-authored-by: Ona <no-reply@ona.com>
1 parent 23fb680 commit 53440d9

6 files changed

Lines changed: 44 additions & 3 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,7 @@ Thumbs.db
2727
# Secrets
2828
.env
2929
.env.*
30+
31+
# Fly deploy artifacts
32+
detect/wheels/
33+
detect/agentsprotocol_pkg/

detect/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/__pycache__
2+
*.pyc
3+
*.pyo

detect/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
COPY wheels/ /wheels/
6+
RUN pip install --no-cache-dir --no-index --find-links=/wheels \
7+
fastapi uvicorn[standard] pydantic numpy scipy cryptography \
8+
&& rm -rf /wheels
9+
10+
COPY agentsprotocol_pkg ./agentsprotocol
11+
COPY api.py .
12+
13+
EXPOSE 8080
14+
15+
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "8080"]

detect/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ def validate(req: ValidateRequest) -> ValidateResponse:
7676
# S_con — semantic consistency of claim against corpus
7777
s = compute_s_con(
7878
claim_text=req.claim,
79-
corpus=corpus,
80-
embed_fn=_stub_embed,
79+
knowledge_corpus=corpus,
80+
embed=_stub_embed,
8181
tau=0.0, # no threshold clipping — return raw score
8282
)
8383

detect/fly.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
app = "agentsprotocol-detect"
2+
primary_region = "fra"
3+
4+
[build]
5+
dockerfile = "Dockerfile"
6+
7+
[http_service]
8+
internal_port = 8080
9+
force_https = true
10+
auto_stop_machines = true
11+
auto_start_machines = true
12+
min_machines_running = 0
13+
14+
[[vm]]
15+
memory = "256mb"
16+
cpu_kind = "shared"
17+
cpus = 1

detect/requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
fastapi>=0.110
22
uvicorn[standard]>=0.29
33
pydantic>=2.0
4-
agentsprotocol @ file://../
4+
numpy
5+
scipy
6+
cryptography

0 commit comments

Comments
 (0)