convez.ai
PluginDesenvolvimento WebAvançado
bh3r1th

TokenFlame

bh3r1th/tokenflame

Flame graph para raciocínio de LLMs — analise divergências token por token

Ver no GitHub
InicialPluginScore · de 0 a 100

Analisador de comportamento em nível de token para gerações de LLMs. Compara como dois modelos respondem ao mesmo prompt, mostrando divergências, incertezas dos modelos e diferenças na tokenização. Inclui visualização de entropia, alinhamento DTW e replay token-a-token.

Instalação

$npx convez-ai bh3r1th/tokenflame

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
42%
Último commit
há 5 meses
Versão
—
Issues abertas
0
Contribuidores
2

Casos de uso

  • Comparar respostas de dois LLMs lado a lado em nível de token
  • Identificar pontos de divergência e incerteza na geração
  • Analisar diferenças de tokenização entre modelos
  • Debugar comportamento de modelos com contexto RAG

Veredito

Ferramenta especializada para pesquisadores e engenheiros de IA que precisam entender o comportamento interno de LLMs em detalhe. Excelente para debug de divergências entre modelos, mas requer conhecimento técnico de tokenização e geração. Não é para produção em escala.

README

A tradução para o português deste README ainda está na fila.

tokenflame

Token-level behavioral profiler for LLM generation. "Flame graph for LLM reasoning."

Works with prepared RAG context and structured prompt inputs. Not a document ingestion framework.


Install

From PyPI (coming soon): pip install tokenflame

From source (current): git clone https://github.com/bh3r1th/tokenflame cd tokenflame/packages/backend pip install -e .

Quick Start

tokenflame run --prompt "What is DNA?" --model-a openai/gpt-5.5 --model-b ollama/llama4-maverick

Output Files

Traces are auto-named with timestamp and prompt slug by default: tokenflame_what_is_dna_20260525_172300.json tokenflame_what_is_dna_20260525_172300.html Use --out to specify an explicit filename: tokenflame run --prompt "..." --out my_trace.json --html

With RAG Context

tokenflame run
--prompt "What does the policy say about returns?"
--context-file retrieved_chunks.txt
--context-mode system
--model-a openai/gpt-5.5
--model-b ollama/llama4-maverick
--out trace_returns.json
--html
--open

View a Saved Trace

tokenflame view trace_returns.json tokenflame view trace_returns.html

Supported Context Formats

FormatNotes
.txtPlain text, UTF-8
.mdMarkdown
.jsonPretty-printed JSON
.jsonlOne JSON object per line
.yamlRequires: pip install pyyaml
.csvTabular, max 500 rows

PDF and DOCX are not supported. Extract text first, save as .txt.

Configure

Create ~/.tokenflame/config.toml:

[providers] openai_api_key = "sk-..." anthropic_api_key = "sk-ant-..." groq_api_key = "..." ollama_host = "http://localhost:11434"

[ui] default_model_a = "openai/gpt-5.5" default_model_b = "ollama/llama4-maverick"

Or use environment variables: OPENAI_API_KEY ANTHROPIC_API_KEY GROQ_API_KEY OLLAMA_HOST

Available Models

Model IDProviderLogprobs
openai/gpt-5.5OpenAI❌ (reasoning model, no logprobs)
openai/gpt-5.4OpenAI❌ (reasoning model, no logprobs)
anthropic/claude-sonnet-4-6Anthropic❌
anthropic/claude-opus-4-6Anthropic❌
anthropic/claude-opus-4-7Anthropic❌
ollama/llama4-maverickOllama (local)⚠️ (logprobs if Ollama >= 0.12.11)
ollama/qwen3:32bOllama (local)⚠️ (logprobs if Ollama >= 0.12.11)

Models without logprob support stream tokens but show no entropy signal.

What tokenflame Shows

  • Entropy heatmap — which tokens were uncertain vs confident
  • Tokenizer diff — where GPT and Llama split text differently
  • DTW alignment — where outputs structurally diverged
  • Divergence markers — exact fork points scored by similarity
  • Replay — scrub through generation token by token

What tokenflame Does NOT Do

  • Retrieval or embedding
  • Document parsing (PDF, DOCX)
  • Eval scoring or CI/CD gates
  • Agent tracing
  • Multi-turn conversation

Trace Schema

All traces are saved as JSON following schema/trace.schema.json. Build your own viewer on top of the schema — it is stable.

License

MIT

Ver o original no GitHub

Bom para

Relacionados