Skip to content

Instantly share code, notes, and snippets.

View kasir-barati's full-sized avatar
Dedicated to achieve his goals

Mohammad Jawad (Kasir) Barati kasir-barati

Dedicated to achieve his goals
View GitHub Profile
@kasir-barati
kasir-barati / costs.md
Last active August 22, 2026 16:57
This is my chat history for my https://github.com/kasir-barati/piper-tts-rest-api where I am trying to add a POST /synthesize endpoint. What I had in mind is written in initial-post-on-dev.to.md but after going back and forth with GPT-5.6-Terra I decided to clean my slate and go back to drawing board with what I learned: https://dev.to/kasir-bar…

Costs

  • I used my OpenAI API key.
  • I used GPT-5.6-Terra.
    • I tried to use GPT-5.6-Luna but it just complained about context window and that it cannot work with it.
      stream disconnected before completion: Request too large for gpt-5.6-luna in organization org-someid on tokens per min (TPM): Limit 200000, Requested 228484. The input or output tokens must be reduced in order to run successfully. Visit https://platform.openai.com/account/rate-limits to learn more.
      
      So even though it is defenitely cheaper model, and it is astonishing value for money. But for me it just hit this issue.
  • I set the reasoning to medium for the whole thing.
@kasir-barati
kasir-barati / otel-collector-config.yaml
Last active August 20, 2026 17:07
Testcontainers + Jaeger
extensions:
health_check:
endpoint: 0.0.0.0:13133
receivers:
otlp:
protocols:
http:
endpoint: 0.0.0.0:4318
grpc:
@kasir-barati
kasir-barati / history.md
Last active August 24, 2026 15:28
OpenAI costs feel to me like extorting money 😅😜. Here is the repository in question: https://github.com/kasir-barati/piper-tts-rest-api

Verify synthesize traceability

I introduced a new API for synthesizing. But I wonder if the OTel logs will be traceable in synthesize.ts since it is a background job unlike speak.ts which is a forground job (tested, all the logs when a 3rd party service calls it with a trace ID attached to the request in Jaeger are still linked to the original reques. AKA its parent is set correctly).

Please make sure the requests coming from external services are traceable and we do NOT loss track of the request, this needs to be true even if we send multiple requests to the synthesize API.

Please also fix the issue of starting the app. I pasted the logs to this message.

So you must run the app, test first if the requests are traceable. And if they are do NOTHING, just explain to me why it is still even though they are running in the background. And if it is not please write a plan.md so I can see what needs to be done. >

@kasir-barati
kasir-barati / AGENTS.md
Last active August 28, 2026 12:17
A simple AGENTS.md and CONTRIBUTING.md (maybe I am abusing the CONTRIBUTING.md). BTW you can symlink AGENTS.md and CLAUDE.md. But that might introduce some issues across different operating systems. So I decided to go with importing.

Project Summary

...

Code Standards & Guidelines

The coding guidelines for this project are maintained in CONTRIBUTING.md. Please read and follow that file.

  • Comments only when necessary.
  • Be concise, short README, no emojis.
{
"name": "Business Development",
"nodes": [
{
"parameters": {
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
{
"name": "Lead Hunter MCP",
"nodes": [
{
"parameters": {
"path": "6bf0134b-d69a-420a-8d2c-8da8899a3ed9"
},
"type": "@n8n/n8n-nodes-langchain.mcpTrigger",
"typeVersion": 2,
"position": [
@kasir-barati
kasir-barati / n8n-ecomerce-web-app-chat-bot.json
Last active August 10, 2026 13:32
Here first we need to seed our database using n8n-supabase-embeding-seeder.json and then you can have your chat bot: n8n-ecomerce-web-app-chat-bot.json. Also the match_documents is used by n8n internally as you can see it here: https://github.com/n8n-io/n8n/blob/269a45d7dd1b9c0a50ab1335bfb455b09475f87d/packages/%40n8n/nodes-langchain/nodes/vecto…
{
"name": "My workflow",
"nodes": [
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
@kasir-barati
kasir-barati / portfolio-rebalancer.workflow.json
Last active August 7, 2026 15:39
Limitations of n8n AI Agents & Tools
{
"name": "Stock Portfolio Agent",
"nodes": [
{
"parameters": {
"rule": {
"interval": [
{
"field": "cronExpression",
"expression": "0 12 * * 1-5"
@kasir-barati
kasir-barati / local-llm.md
Last active July 31, 2026 10:22
Local LLM

Ollama exposes an OpenAI-compatible API on port 11434, so most OpenAI-compatible tools can talk to it by simply changing the base URL. I am gonna try Qwen3-Coder 14B, light enough for a much nicer developer experience while still having enough resources left for Docker, VS Code, PostgreSQL, browsers, etc.

Ollama supports OpenAI-style /v1/chat/completions, you can test it:

curl http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3-coder:14b",
 "messages": [