Skip to content

Commit a74f981

Browse files
committed
docs: install the @intX peers alongside in the README
1 parent 44a8c2e commit a74f981

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ bun run lint
99
bun run test
1010
```
1111

12-
`bun run test` includes a live `/v1/embeddings` round trip that runs when
13-
`EMBEDDING_E2E_BASE_URL` (default `http://localhost:11434/v1`) is reachable
14-
and skips otherwise. `EMBEDDING_E2E_MODEL` defaults to `nomic-embed-text`.
12+
`bun run test` is hermetic. `bun run test:live` runs a `/v1/embeddings` round
13+
trip and skips unless `EMBEDDING_E2E_BASE_URL` is set; point it at a remote
14+
server rather than loading models locally:
15+
16+
```bash
17+
EMBEDDING_E2E_BASE_URL=http://100.113.184.123:11434/v1 bun run test:live
18+
```
19+
20+
`EMBEDDING_E2E_MODEL` defaults to `nomic-embed-text`.
1521

1622
## Versioning
1723

‎README.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ OpenAI, Ollama, TEI, vLLM, and Jina all serve the same wire shape. This package
1111
## Install
1212

1313
```bash
14-
bun add @corbits/embedding
14+
bun add @corbits/embedding @intx/inference@^0.4.0 @intx/types@^0.4.0
1515
```
1616

17-
Runs on Bun >= 1.2 or Node >= 24. The built `dist/` entry is the default import.
17+
Runs on Bun >= 1.2 or Node >= 24.
1818

1919
## Quickstart
2020

@@ -32,7 +32,8 @@ console.log(vectors.length, vectors[0]?.length); // 2 768
3232

3333
`embedTexts(texts, config, options?)` batches sequentially, posts each batch to
3434
`{baseURL}/embeddings`, and returns vectors in input order. `options` is
35-
optional: `deps` (defaults to global `fetch` and `createDefaultScheduler()`),
35+
optional: `deps` (defaults to global `fetch` and `@intx/inference`'s
36+
`createDefaultScheduler()`),
3637
`retryPolicy`, `extractRetryAfterMs`, and `signal`.
3738

3839
## Dimensionality
@@ -41,11 +42,11 @@ optional: `deps` (defaults to global `fetch` and `createDefaultScheduler()`),
4142

4243
## Errors
4344

44-
Every failure — transport, HTTP status, or a 200 with an unexpected body — throws `EmbeddingRequestError` (`extends Error`), carrying the classified `InferenceError` as `reason` and the request `url`. A config that fails `EmbedConfigSchema` throws before any request.
45+
Every request failure — transport, HTTP status, or a 200 with an unexpected body — throws `EmbeddingRequestError` (`extends Error`), carrying the classified `InferenceError` as `reason` and the request `url`. A config that fails `EmbedConfigSchema` throws arktype's `TraversalError` before any request.
4546

4647
## Using with Interchange
4748

48-
Transport, error classification, and retry build on `@intx/inference`: requests go through `deps.fetch`, failures classify into `InferenceError` just like chat calls, and `createDefaultRetryPolicy` guides backoff. A 429 from an embeddings endpoint behaves like one from a chat endpoint, and credential failures short-circuit. `@intx/inference` and `@intx/types` are peer dependencies, so the host's Interchange version is the one used.
49+
Requests go through `deps.fetch`, failures are classified into `@intx/inference`'s `InferenceError`, and `createDefaultRetryPolicy` decides retries: a 429 backs off and retries, a credential failure does not. `@intx/inference` and `@intx/types` are peer dependencies, so the host's Interchange version is the one used.
4950

5051
## License
5152

0 commit comments

Comments
 (0)