Skip to main content
Glama
summarizer.js834 B
import { LlamaEngine } from './llama-engine.js'; export class OllamaSummarizer { engine; maxInputTokens; constructor(config = {}) { this.engine = LlamaEngine.getInstance({ modelName: config.model || 'llama-3.2-1b-instruct-q4_k_m.gguf', }); this.maxInputTokens = config.maxInputTokens || 2000; } async summarize(content) { try { const available = await this.engine.isAvailable(); if (!available) { return null; } const truncated = content.substring(0, this.maxInputTokens * 4); return await this.engine.summarize(truncated); } catch (error) { console.error('Summarizer error:', error); return null; } } } //# sourceMappingURL=summarizer.js.map

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alucardeht/isis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server