mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-22 08:38:08 +02:00
rename klo to ktx
This commit is contained in:
parent
1a42152e6f
commit
3ce510b55b
704 changed files with 10205 additions and 10255 deletions
|
|
@ -8,8 +8,8 @@ import { fileURLToPath } from 'node:url';
|
|||
const require = createRequire(import.meta.url);
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
const contextDir = resolve(scriptDir, '..');
|
||||
const kloRoot = resolve(contextDir, '../..');
|
||||
const docsDir = join(kloRoot, 'docs');
|
||||
const ktxRoot = resolve(contextDir, '../..');
|
||||
const docsDir = join(ktxRoot, 'docs');
|
||||
const reportPath = join(docsDir, 'hybrid-search-pglite-spike.md');
|
||||
|
||||
async function timed(label, fn) {
|
||||
|
|
@ -63,7 +63,7 @@ async function packageInfo(packageName) {
|
|||
return {
|
||||
name: packageName,
|
||||
version: packageJson.version,
|
||||
path: relative(kloRoot, packageDir),
|
||||
path: relative(ktxRoot, packageDir),
|
||||
bytes: await directoryBytes(packageDir),
|
||||
};
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@ async function main() {
|
|||
});
|
||||
|
||||
const { PGlite, vector, pg_trgm } = importTimer.value;
|
||||
const tempDir = await mkdtemp(join(tmpdir(), 'klo-pglite-report-'));
|
||||
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-pglite-report-'));
|
||||
const dataDir = join(tempDir, 'pgdata');
|
||||
|
||||
let db;
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import { Client } from 'pg';
|
|||
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
const contextDir = resolve(scriptDir, '..');
|
||||
const kloRoot = resolve(contextDir, '../..');
|
||||
const reportPath = join(kloRoot, 'docs', 'hybrid-search-pglite-owner-process.md');
|
||||
const ktxRoot = resolve(contextDir, '../..');
|
||||
const reportPath = join(ktxRoot, 'docs', 'hybrid-search-pglite-owner-process.md');
|
||||
|
||||
async function timed(label, fn) {
|
||||
const started = performance.now();
|
||||
|
|
@ -98,7 +98,7 @@ async function createOwner(dataDir, port) {
|
|||
port,
|
||||
user: 'postgres',
|
||||
database: 'postgres',
|
||||
application_name: 'klo-pglite-owner-report',
|
||||
application_name: 'ktx-pglite-owner-report',
|
||||
connectionTimeoutMillis: 5_000,
|
||||
},
|
||||
};
|
||||
|
|
@ -222,7 +222,7 @@ async function stopOwner(owner) {
|
|||
}
|
||||
|
||||
async function main() {
|
||||
const tempDir = await mkdtemp(join(tmpdir(), 'klo-pglite-owner-report-'));
|
||||
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-pglite-owner-report-'));
|
||||
const dataDir = join(tempDir, 'pgdata');
|
||||
const port = await allocatePort();
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ import { Client } from 'pg';
|
|||
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
const contextDir = resolve(scriptDir, '..');
|
||||
const kloRoot = resolve(contextDir, '../..');
|
||||
const reportPath = join(kloRoot, 'docs', 'hybrid-search-pglite-sl-adapter-prototype.md');
|
||||
const ktxRoot = resolve(contextDir, '../..');
|
||||
const reportPath = join(ktxRoot, 'docs', 'hybrid-search-pglite-sl-adapter-prototype.md');
|
||||
|
||||
async function timed(label, fn) {
|
||||
const started = performance.now();
|
||||
|
|
@ -91,7 +91,7 @@ async function createOwner(dataDir, port) {
|
|||
port,
|
||||
user: 'postgres',
|
||||
database: 'postgres',
|
||||
application_name: 'klo-pglite-sl-prototype-report',
|
||||
application_name: 'ktx-pglite-sl-prototype-report',
|
||||
connectionTimeoutMillis: 5_000,
|
||||
},
|
||||
};
|
||||
|
|
@ -193,7 +193,7 @@ async function stopOwner(owner) {
|
|||
}
|
||||
|
||||
async function main() {
|
||||
const tempDir = await mkdtemp(join(tmpdir(), 'klo-pglite-sl-prototype-report-'));
|
||||
const tempDir = await mkdtemp(join(tmpdir(), 'ktx-pglite-sl-prototype-report-'));
|
||||
const dataDir = join(tempDir, 'pgdata');
|
||||
const port = await allocatePort();
|
||||
let owner;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { dirname, join, resolve } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import {
|
||||
KLO_RELATIONSHIP_BENCHMARK_MODES,
|
||||
buildKloRelationshipBenchmarkReport,
|
||||
currentKloRelationshipBenchmarkDetector,
|
||||
formatKloRelationshipBenchmarkReportMarkdown,
|
||||
kloRelationshipBenchmarkDetectorWithLlm,
|
||||
loadKloRelationshipBenchmarkFixtures,
|
||||
runKloRelationshipBenchmarkSuite,
|
||||
KTX_RELATIONSHIP_BENCHMARK_MODES,
|
||||
buildKtxRelationshipBenchmarkReport,
|
||||
currentKtxRelationshipBenchmarkDetector,
|
||||
formatKtxRelationshipBenchmarkReportMarkdown,
|
||||
ktxRelationshipBenchmarkDetectorWithLlm,
|
||||
loadKtxRelationshipBenchmarkFixtures,
|
||||
runKtxRelationshipBenchmarkSuite,
|
||||
} from '../dist/scan/index.js';
|
||||
|
||||
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
||||
|
|
@ -15,38 +15,38 @@ const packageRoot = resolve(scriptDir, '..');
|
|||
const fixtureRoot = join(packageRoot, 'test/fixtures/relationship-benchmarks');
|
||||
|
||||
async function buildDetector() {
|
||||
const backend = process.env.KLO_BENCHMARK_LLM_BACKEND;
|
||||
const backend = process.env.KTX_BENCHMARK_LLM_BACKEND;
|
||||
if (!backend || backend === 'none') {
|
||||
return currentKloRelationshipBenchmarkDetector();
|
||||
return currentKtxRelationshipBenchmarkDetector();
|
||||
}
|
||||
if (backend !== 'vertex') {
|
||||
throw new Error(`Unsupported KLO_BENCHMARK_LLM_BACKEND: ${backend}`);
|
||||
throw new Error(`Unsupported KTX_BENCHMARK_LLM_BACKEND: ${backend}`);
|
||||
}
|
||||
const project = process.env.KLO_BENCHMARK_VERTEX_PROJECT;
|
||||
const location = process.env.KLO_BENCHMARK_VERTEX_LOCATION;
|
||||
const model = process.env.KLO_BENCHMARK_LLM_MODEL ?? 'claude-sonnet-4-6';
|
||||
const project = process.env.KTX_BENCHMARK_VERTEX_PROJECT;
|
||||
const location = process.env.KTX_BENCHMARK_VERTEX_LOCATION;
|
||||
const model = process.env.KTX_BENCHMARK_LLM_MODEL ?? 'claude-sonnet-4-6';
|
||||
if (!project || !location) {
|
||||
throw new Error('KLO_BENCHMARK_VERTEX_PROJECT and KLO_BENCHMARK_VERTEX_LOCATION are required for vertex backend');
|
||||
throw new Error('KTX_BENCHMARK_VERTEX_PROJECT and KTX_BENCHMARK_VERTEX_LOCATION are required for vertex backend');
|
||||
}
|
||||
const { createKloLlmProvider } = await import('@klo/llm');
|
||||
const provider = createKloLlmProvider({
|
||||
const { createKtxLlmProvider } = await import('@ktx/llm');
|
||||
const provider = createKtxLlmProvider({
|
||||
backend: 'vertex',
|
||||
vertex: { project, location },
|
||||
modelSlots: { default: model },
|
||||
});
|
||||
return kloRelationshipBenchmarkDetectorWithLlm(provider);
|
||||
return ktxRelationshipBenchmarkDetectorWithLlm(provider);
|
||||
}
|
||||
|
||||
const fixtures = await loadKloRelationshipBenchmarkFixtures(fixtureRoot);
|
||||
const fixtures = await loadKtxRelationshipBenchmarkFixtures(fixtureRoot);
|
||||
const detector = await buildDetector();
|
||||
const suite = await runKloRelationshipBenchmarkSuite({
|
||||
const suite = await runKtxRelationshipBenchmarkSuite({
|
||||
fixtures,
|
||||
detector,
|
||||
});
|
||||
const report = buildKloRelationshipBenchmarkReport({
|
||||
const report = buildKtxRelationshipBenchmarkReport({
|
||||
fixtures,
|
||||
suite,
|
||||
modes: KLO_RELATIONSHIP_BENCHMARK_MODES,
|
||||
modes: KTX_RELATIONSHIP_BENCHMARK_MODES,
|
||||
});
|
||||
|
||||
process.stdout.write(formatKloRelationshipBenchmarkReportMarkdown(report));
|
||||
process.stdout.write(formatKtxRelationshipBenchmarkReportMarkdown(report));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue