Implemented an --llm-concurrency flag in the Go application that enforces a global LLM concurrency cap
This commit is contained in:
@@ -69,7 +69,7 @@ func (m *Module) Propose(ctx context.Context, req contracts.ProposalRequest) ([]
|
||||
Glossary: req.Glossary,
|
||||
Config: req.Config,
|
||||
Messages: messages,
|
||||
StageName: fmt.Sprintf("%s:proposal", req.RunSpec.InstanceName),
|
||||
StageName: proposalStageName(req),
|
||||
StartIndex: 0,
|
||||
LLMClient: req.LLMClient,
|
||||
Scheduler: req.LLMScheduler,
|
||||
@@ -93,3 +93,10 @@ func transcriptForSection(transcript *schema.Transcript, section *contracts.Sect
|
||||
}
|
||||
return &schema.Transcript{Segments: segments}
|
||||
}
|
||||
|
||||
func proposalStageName(req contracts.ProposalRequest) string {
|
||||
if req.Section == nil || req.Section.Index == 0 {
|
||||
return fmt.Sprintf("%s:proposal", req.RunSpec.InstanceName)
|
||||
}
|
||||
return fmt.Sprintf("%s:proposal:section-%04d", req.RunSpec.InstanceName, req.Section.Index)
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ func (m *Module) Propose(ctx context.Context, req contracts.ProposalRequest) ([]
|
||||
Glossary: req.Glossary,
|
||||
Config: req.Config,
|
||||
Messages: messages,
|
||||
StageName: fmt.Sprintf("%s:proposal", req.RunSpec.InstanceName),
|
||||
StageName: proposalStageName(req),
|
||||
StartIndex: 0,
|
||||
LLMClient: req.LLMClient,
|
||||
Scheduler: req.LLMScheduler,
|
||||
@@ -93,3 +93,10 @@ func transcriptForSection(transcript *schema.Transcript, section *contracts.Sect
|
||||
}
|
||||
return &schema.Transcript{Segments: segments}
|
||||
}
|
||||
|
||||
func proposalStageName(req contracts.ProposalRequest) string {
|
||||
if req.Section == nil || req.Section.Index == 0 {
|
||||
return fmt.Sprintf("%s:proposal", req.RunSpec.InstanceName)
|
||||
}
|
||||
return fmt.Sprintf("%s:proposal:section-%04d", req.RunSpec.InstanceName, req.Section.Index)
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ func (m *Module) Propose(ctx context.Context, req contracts.ProposalRequest) ([]
|
||||
Glossary: req.Glossary,
|
||||
Config: req.Config,
|
||||
Messages: messages,
|
||||
StageName: fmt.Sprintf("%s:proposal", req.RunSpec.InstanceName),
|
||||
StageName: proposalStageName(req),
|
||||
StartIndex: 0,
|
||||
LLMClient: req.LLMClient,
|
||||
Scheduler: req.LLMScheduler,
|
||||
@@ -93,3 +93,10 @@ func transcriptForSection(transcript *schema.Transcript, section *contracts.Sect
|
||||
}
|
||||
return &schema.Transcript{Segments: segments}
|
||||
}
|
||||
|
||||
func proposalStageName(req contracts.ProposalRequest) string {
|
||||
if req.Section == nil || req.Section.Index == 0 {
|
||||
return fmt.Sprintf("%s:proposal", req.RunSpec.InstanceName)
|
||||
}
|
||||
return fmt.Sprintf("%s:proposal:section-%04d", req.RunSpec.InstanceName, req.Section.Index)
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ func (m *Module) Propose(ctx context.Context, req contracts.ProposalRequest) ([]
|
||||
Glossary: req.Glossary,
|
||||
Config: req.Config,
|
||||
Messages: messages,
|
||||
StageName: fmt.Sprintf("%s:proposal", req.RunSpec.InstanceName),
|
||||
StageName: proposalStageName(req),
|
||||
StartIndex: 0,
|
||||
LLMClient: req.LLMClient,
|
||||
Scheduler: req.LLMScheduler,
|
||||
@@ -93,3 +93,10 @@ func transcriptForSection(transcript *schema.Transcript, section *contracts.Sect
|
||||
}
|
||||
return &schema.Transcript{Segments: segments}
|
||||
}
|
||||
|
||||
func proposalStageName(req contracts.ProposalRequest) string {
|
||||
if req.Section == nil || req.Section.Index == 0 {
|
||||
return fmt.Sprintf("%s:proposal", req.RunSpec.InstanceName)
|
||||
}
|
||||
return fmt.Sprintf("%s:proposal:section-%04d", req.RunSpec.InstanceName, req.Section.Index)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user