Skip to content

7.4 billion tokens per month. 34 free LLM providers. 635 free model endpoints. All behind one /v1 endpoint, plus any custom OpenAI-compatible endpoint. Smart routing, automatic failover, encrypted keys. Personal experimentation only.

TypeScript

fix(cli): use gateway port for default URL (#1437)

ammann45cbc49dec1d
diff --git a/cli/src/index.test.ts b/cli/src/index.test.ts
index 0c1f40db..7c5cada7 100644
--- a/cli/src/index.test.ts
+++ b/cli/src/index.test.ts
@@ -7,6 +7,17 @@ import { UnknownModelError } from './models.js';
import type { CatalogModel } from './types.js';
describe('CLI arguments and launchers', () => {
+ it('defaults to the gateway port when no URL is configured', () => {
+ const previous = process.env.FREELLMAPI_URL;
+ delete process.env.FREELLMAPI_URL;
+ try {
+ expect(parseArgs(['setup-generic']).options.url).toBe('http://localhost:3001');
+ } finally {
+ if (previous === undefined) delete process.env.FREELLMAPI_URL;
+ else process.env.FREELLMAPI_URL = previous;
+ }
+ });
+
it('parses setup options before or after the command', () => {
expect(parseArgs([
'--url',
diff --git a/cli/src/index.ts b/cli/src/index.ts
index 78fbafa2..cdd8bc16 100644
--- a/cli/src/index.ts
+++ b/cli/src/index.ts
@@ -49,7 +49,7 @@ function parseTimeout(value: string): number {
export function parseArgs(argv: string[]): { command?: string; options: CliOptions } {
const options: CliOptions = {
- url: process.env.FREELLMAPI_URL || 'http://localhost:3000',
+ url: process.env.FREELLMAPI_URL || 'http://localhost:3001',
apiKey: process.env.FREELLMAPI_API_KEY,
token: process.env.FREELLMAPI_DASHBOARD_TOKEN,
profile: 'default',