npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sylix

v5.1.0

Published

The official Sylix AI SDK for TypeScript and JavaScript. Build intelligent applications with Helix models (helix-1.0, helix-code, helix-r1) featuring tool calling, reasoning, streaming, and OpenAI-compatible APIs. Enterprise-grade AI infrastructure for de

Readme

Sylix Node.js SDK

npm version npm downloads License

The official Node.js/TypeScript library for the Sylix AI API, providing convenient access to Charles AI models from Node.js applications.

⚠️ Important: This library is intended for server-side usage only. Using it in client-side browser code will expose your API key.

Installation

npm install sylix

Requirements: Node.js 18+

Usage

import Sylix from 'sylix';

const client = new Sylix({
  apiKey: process.env['SYLIX_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const response = await client.charles.chat.completions.create({
    model: 'charles-s1:latest',
    messages: [{ role: 'user', content: 'Hello, Charles!' }],
  });

  console.log(response.choices[0].message.content);
}

main();

Streaming

We support streaming responses using Server Sent Events (SSE):

import Sylix from 'sylix';

const client = new Sylix();

async function main() {
  const stream = await client.charles.chat.completions.create({
    model: 'charles-s1:latest',
    messages: [{ role: 'user', content: 'Write a short poem' }],
    stream: true,
  });

  for await (const chunk of stream) {
    process.stdout.write(chunk.choices[0]?.delta?.content || '');
  }
}

main();

Request & Response Types

This library includes TypeScript definitions for all request params and response fields:

import Sylix from 'sylix';
import { ChatRequest, ChatResponse, ChatMessage } from 'sylix';

const client = new Sylix();

const messages: ChatMessage[] = [
  { role: 'system', content: 'You are a helpful assistant.' },
  { role: 'user', content: 'What is TypeScript?' },
];

const params: ChatRequest = {
  model: 'charles-s1:latest',
  messages,
  temperature: 0.7,
};

const response: ChatResponse = await client.charles.chat.completions.create(params);

Available Models

| Model | ID | Description | |-------|-----|-------------| | Charles Mini | charles-mini:latest | Lightweight, fast responses | | Charles S1 | charles-s1:latest | Balanced performance for coding | | Charles V1 | charles-v1:latest | Advanced reasoning capabilities | | Charles 2.9 | charles-2.9:latest | State-of-the-art performance | | Charles R1 | charles-r1:latest | Deep reasoning and analysis |

import { CHARLES_MODELS } from 'sylix';

// Use model constants for type safety
const response = await client.charles.chat.completions.create({
  model: CHARLES_MODELS.S1, // 'charles-s1:latest'
  messages: [{ role: 'user', content: 'Hello!' }],
});

Handling Errors

When the API returns a non-success status code, an error is thrown:

import Sylix, { SylixError } from 'sylix';

const client = new Sylix();

async function main() {
  try {
    const response = await client.charles.chat.completions.create({
      model: 'invalid-model',
      messages: [{ role: 'user', content: 'Hello' }],
    });
  } catch (err) {
    if (err instanceof SylixError) {
      console.log(err.code);    // e.g., 'INVALID_MODEL'
      console.log(err.message); // Detailed error message
    } else {
      throw err;
    }
  }
}

main();

Error Codes

| Code | Description | |------|-------------| | MISSING_API_KEY | API key not provided | | INVALID_MODEL | Model not found or unavailable | | INVALID_API_KEY | Invalid or expired API key | | RATE_LIMIT_ERROR | Too many requests | | STREAM_ERROR | Streaming connection error | | NETWORK_ERROR | Network connectivity issue |

Retries

The library automatically retries on connection errors, 408, 429, and 5XX status codes. You can configure this:

const client = new Sylix({
  maxRetries: 2, // default is 4
  timeout: 30000, // default is 30 seconds
});

Function Calling

const response = await client.charles.chat.completions.create({
  model: 'charles-v1:latest',
  messages: [{ role: 'user', content: 'What is the weather in Tokyo?' }],
  tools: [
    {
      type: 'function',
      function: {
        name: 'get_weather',
        description: 'Get current weather for a location',
        parameters: {
          type: 'object',
          properties: {
            location: { type: 'string', description: 'City name' },
          },
          required: ['location'],
        },
      },
    },
  ],
  tool_choice: 'auto',
});

// Check if the model wants to call a function
if (response.choices[0].message.tool_calls) {
  const toolCall = response.choices[0].message.tool_calls[0];
  console.log('Function:', toolCall.function.name);
  console.log('Arguments:', toolCall.function.arguments);
}

Embeddings

Generate vector embeddings for text:

const response = await client.charles.embeddings.create({
  model: 'charles-mini:latest',
  input: 'The quick brown fox jumps over the lazy dog',
});

console.log(response.data[0].embedding); // Vector array

Models API

// List all available models
const models = await client.charles.models.list();
console.log(models.data);

// Get a specific model
const model = await client.charles.models.retrieve('charles-s1:latest');
console.log(model);

Configuration

import Sylix from 'sylix';

const client = new Sylix({
  apiKey: process.env['SYLIX_API_KEY'], // Required
  baseURL: 'https://api.sylixide.com/v1', // Default
  timeout: 60000, // Request timeout in ms
  maxRetries: 4, // Retry attempts for failed requests
});

Environment Variables

| Variable | Description | |----------|-------------| | SYLIX_API_KEY | Your Sylix API key | | SYLIX_BASE_URL | Override the default base URL |

Semantic Versioning

This package follows SemVer conventions.

We recommend pinning to a specific version and upgrading periodically:

npm install [email protected]

Requirements

  • Node.js 18 or higher
  • TypeScript 4.7+ (for TypeScript users)

Support

License

Proprietary License © 2026 Sylix Technologies. All rights reserved.

See LICENSE for details.